Mod Rewrite Not Working Properly |
[eluser]Pawel K[/eluser]
Hello, I followed the user guide to get rid of index.php from my URLs. But I can't get this to work. This is my .htaccess file located under /home/mesa/public_html/cart: Code: RewriteEngine on But this will not work. When I go to /cart/admin it always fetches the default welcome message. If I go to /cart/index.php/admin then it works just fine. I added RewriteBase after searching the forums, it didn't help me. Any help with this problem would be greatly appreciated, I searched around the forums and tried various solutions with no luck. Could it be an issue with the fact that my installation is in a subdirectory of the document root? I didn't think that mattered.
[eluser]tomcode[/eluser]
Try it taking out the slash in front of index.php : Code: RewriteRule ^(.*)$ index.php/$1 [L]
[eluser]Aken[/eluser]
Your RewriteBase is wrong, it does not have to do with the physical location of your files, it has to do with the base directory of the URL the user is visiting. More info here. I'd recommend using a better written .htaccess. Check this one out, and make sure to customize it to suit your application.
[eluser]tomcode[/eluser]
[quote author="Aken" date="1273471820"]Your RewriteBase is wrong, ... [/quote] Totally right. Guess I better stop posting late in the night. [quote author="Aken" date="1273471820"]....I'd recommend using a better written .htaccess. [/quote] Me, too, I use that flavour, though without the system and app part.
[eluser]Unknown[/eluser]
For Directory Root "/home/mesa/public_html/", try this: Code: RewriteEngine on
[eluser]Pawel K[/eluser]
Thank you for all the replies, Aken the link you gave me worked like a charm after changing a few of the lines. I also appreciate the RewriteBase explaination, makes sense. I have one more question. I would like to use the .html extension which I set up in the config file. So instead of admin/login I want admin/login.html. Can anyone offer suggestions on how to do that with my htaccess file? Thanks. Current file: Code: <IfModule mod_rewrite.c> |
Welcome Guest, Not a member yet? Register Sign In |