Alright, so I feel like an idiot asking this, but after reading through the documentation and trying everything I could think of, I’m still stuck
I’m trying to remove index.php from the URL string. It’s not working, however: navigating to http://localhost/tastebud (would be tastebud/index.php before) doesn’t work. My .htaccess looks like this the same as http://www.yiiframew…uide/topics.url, but with the last line changed per Bethrezen’s comment - neither the original or modified work.
Commenting out the rules part did nothing, and rewriting the path worked until I tried to hide index.php. I'm using Windows with Xampplite, and the mod_rewrite in httpd.conf is turned on. I'm a little confused, since nobody else is having this problem: so maybe it's something simple.
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule ^.*$ /index.php [L]
I've tried it with 'RewriteRule . index.php' instead of the one I have currently, but both failed.
Ah, thanks rickgrana. That did the trick. AllowOverride was set to 'all' earlier in the httpd.conf, and then turned down to 'fileinfo' a little later (but that part had missed me).
So it's working now: if anybody else runs into the same problem, check your apache/httpd.conf file and make sure EVERY AllowOverride is set to all under <Directory>.
Looks like I rejoiced too soon: I can get to the root page (localhost/site) no problem, but none of the links work. Entering the old url before removing index.php (http://localhost/tastebud/index.php?r=browse/taste) just takes me back to index.php again, any other URL takes me to my Xampp index page. Any ideas?
I have this working without any problem, make sure that your apache is set up correctly to allow mod_rewrite and htaccess files and ofcourse the mod_rewrite engine is on.
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Looks like I rejoiced too soon: I can get to the root page (localhost/site) no problem, but none of the links work. Entering the old url before removing index.php (http://localhost/tastebud/index.php?r=browse/taste) just takes me back to index.php again, any other URL takes me to my Xampp index page. Any ideas?
For rewriting the URL following things should be done in httpd file of Apache:-
1] mod_rewrite module should be uncommented.
2] In <Directory> section AllowOverride None should be replaced with AllowOverride All.
3] Application directory must contain a .htaccess file with following code:-
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteBase /Your Application Directory Name/ //This line must require in your .htaccess.
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php