Remove index.php from URIs |
[eluser]RomanN[/eluser]
Hello all. As I have read on another forum's topic to remove index.php from URI I need simply modify my .htacceess file. After adding the below code into the file everything seemed to work well. Code: <IfModule mod_rewrite.c> But it works correctly only for default controller. When I'm trying to type some other controller with function and some parameter I'm getting "Oops! This link appears to be broken." error. Can somebody help with it, please. Thanks! P.S. May be next info will be helpful. I'm using Snow Leopard as OS, MAMP for working with Apache/PHP/MySQL. Index page config parameter is empty. Code: $config['index_page'] = "";
[eluser]BrianL[/eluser]
"Oops! This link appears to be broken" is DNS error from browsers when typing in wrong domain name. RewriteRule ^(.*)$ /index.php/$1 [L] redirect to http://example.com/index.php/$1 RewriteRule ^(.*)$ index.php/$1 [L] redirect to http://example.comindex.php/$1
[eluser]RomanN[/eluser]
Thank you, BrianL, for quick response. I have tried you mode rewrite rule, but without success. The problem is the same as previous. I'll try to describe it more carefully. 1. http://localhost/site_name/index.php - works well 2. http://localhost/site_name/ - also works correctly. 3. http://localhost/site_name/index.php/con.../parameter - All is ok. 4. http://localhost/site_name/controller_na.../parameter - Doesn't work! As you can see second url works nice without index.php specified. The third also works. It means that controller, method and parameter are passed correctly. Can somebody help me with fourth url? Thanks.
[eluser]RomanN[/eluser]
Thank you all for helping. Below rule fixed the problem: Code: RewriteEngine on
[eluser]pickupman[/eluser]
Glad you got it working. It looks your first solution was a problem with RewriteBase /. Since you were in a subfolder it would be rewriting to http://localhost/. The other url's with index.php are requesting index.php file which is why they were working. |
Welcome Guest, Not a member yet? Register Sign In |