.htaccess and routing |
[eluser]ibnclaudius[/eluser]
I want to send the parameter like: Quote:http://localhost/index.php/myparameter so I made this routing: Code: $route['(:any)'] = 'events/event/$1'; cause my main controller is something like: Code: class Events extends CI_Controller { until this point everything works, but the error starts when trying to remove the index.php from the url, by creating this .htaccess: Code: RewriteEngine on and removing the index.php from: Code: $config['index_page'] = 'index.php'; but when I try to access an url like http://localhost/myparameter I get a not found! :S And yes, mod_rewrite is enabled!
[eluser]Harold Villacorte[/eluser]
This works for me, basically just add the Query String Append. Code: DirectoryIndex index.php
[eluser]ibnclaudius[/eluser]
Now I'm having again the problem with 403 Forbidden when trying to use .htaccess =/
[eluser]Harold Villacorte[/eluser]
It could be the read permission of the .htaccess file. It has to be readable.
[eluser]ibnclaudius[/eluser]
Solved the 403 Forbidden by adding: Options +Indexes +FollowSymLinks +ExecCGI
[eluser]ibnclaudius[/eluser]
[quote author="Harold Villacorte" date="1362773807"]This works for me, basically just add the Query String Append. Code: DirectoryIndex index.php When trying to access the url using your .htaccess: http://localhost/myparameter i get this error: The requested URL /Users/ibnclaudius/Sites/ibnight/index.php/1 was not found on this server.
[eluser]Harold Villacorte[/eluser]
Mabe you should try some different rewrite patterns: Code: ./index.php/$1
[eluser]Harold Villacorte[/eluser]
I can't say I know where your problem is, this all would work for me. Maybe someone else will jump in, cheers. |
Welcome Guest, Not a member yet? Register Sign In |