Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 550657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:18:43+00:00 2026-05-13T11:18:43+00:00

When I use the form::open in Kohana 3, I get this <form action=/my-site/index.php/bla method=post

  • 0

When I use the form::open in Kohana 3, I get this

<form action="/my-site/index.php/bla" method="post" accept-charset="utf-8"> 

Nowhere on my site do I rely on the index.php being there. I think it looks ugly. Is there an easy way to remove the index.php from it.

Obviously I know I could do a str_replace(), but I thought there may be a more elegant way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:18:43+00:00Added an answer on May 13, 2026 at 11:18 am

    Kohana (as well as CodeIgniter and most of other frameworks) relies on the Front-Controller Pattern (index.php) so unless you deeply hacked it I cannot see how you don’t need to rely on it.

    After a quick look at the form::open() source:

    public static function open($action = NULL, array $attributes = NULL)
    {
        if ($action === NULL)
        {
            // Use the current URI
            $action = Request::instance()->uri;
        }
    
        if ($action === '')
        {
            // Use only the base URI
            $action = Kohana::$base_url;
        }
        elseif (strpos($action, '://') === FALSE)
        {
            // Make the URI absolute
            $action = URL::site($action);
        }
    
        // ...
    }
    

    I don’t think it’s possible without specifying a absolute URL. Might be a solution if you don’t mind doing:

    form::open('http://domain.com/my-site/bla');
    

    Otherwise your best approach would be to str_replace() or override the it with an application helper.


    If you edit the url helper (/system/classes/kohana/url.php) and change line 71 from this:

    return URL::base(TRUE, $protocol).$path.$query.$fragment;
    

    To this:

    return URL::base(FALSE, $protocol).$path.$query.$fragment;
    

    All index.php appearances should be gone.


    I’m not sure if this will work, but in application/bootstrap.php change this:

    Kohana::init(array('base_url' => '/kohana/'));
    

    To this:

    Kohana::init(array('base_url' => '/kohana/', 'index_file' => ''));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any reasons to ever use the two-argument form of open(...) in Perl
I use this syntax to open my files, since I learned that some years
Form1 frm = new Form1(); frm1.ShowDialog(); I use this to create new form to
Normally you use Form.Visible to check if Window is visible at all. But sometimes
I'm trying to use form's CheckboxSelectMultiple widget but I I'd like to change the
Is there a way to use form fields that does not correspond to database
I have configured my application to use form based authentication and set up the
I have a search form on each of my pages. If I use form
In rails, is it recommended to use form helpers? Internally, everything boils down to
I am designing a secure login with JSP. I intend to use Form Authorization

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.