Kohana (as well as CodeIgniter and most other frameworks) relies on the Front-Controller Pattern ( index.php ), so if you hack it deeply, I donβt see how you do not need to rely on it.
After a quick look at the source of form::open() :
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 do not think this is possible without specifying an absolute URL. Perhaps this is the solution if you don't mind:
form::open('http://domain.com/my-site/bla');
Otherwise, str_replace() or overriding it with the application helper would be the best approach .
If you edit the url helper ( /system/classes/kohana/url.php ) and change line 71 to this:
return URL::base(TRUE, $protocol).$path.$query.$fragment;
For this:
return URL::base(FALSE, $protocol).$path.$query.$fragment;
All index.php messages should disappear.
I'm not sure if this will work, but in application/bootstrap.php change this:
Kohana::init(array('base_url' => '/kohana/'));
For this:
Kohana::init(array('base_url' => '/kohana/', 'index_file' => ''));
source share