Mod Rewrite works if site is in a sub directory but not in the root - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Mod Rewrite works if site is in a sub directory but not in the root (/showthread.php?tid=18385) |
Mod Rewrite works if site is in a sub directory but not in the root - El Forum - 05-04-2009 [eluser]Ty Bex[/eluser] When i designed the website it was on my server http://www.domainname.com/DEV/ and the mod rewrite worked fine. Code: /* Since I moved it to the new website. http://www.plymouthparksoccer.org/ I had to load in the index_page variable for the site to work. Code: /* The Mod requite is being picked up because if I mess up the syntax is throws a server error. Code: <IfModule mod_rewrite.c> If I do not load the index_page variable with index.php. The links will all show correctly but it only displays the home page no matter what the address bar states. The site right now is working with the index.php assigned but I would really love to know why it works if the site is in a sub directory and not if the site is in the root of the domain. Mod Rewrite works if site is in a sub directory but not in the root - El Forum - 05-05-2009 [eluser]Ty Bex[/eluser] Any Idea's.. Mod Rewrite works if site is in a sub directory but not in the root - El Forum - 05-05-2009 [eluser]Daniel Moore[/eluser] For a complete walk-through of a good .htaccess, visit: http://www.danielwmoore.com/remove_index_from_codeigniter My first suggestion is to change: Code: RewriteRule ^(.*)$ index.php/$1 [L] to: Code: RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA] The above referenced link should tell you why if you read through it all. This may very well fix the situation you are experiencing. Another issue I would address is a simple house-cleaning issue. Your lines: Code: RewriteCond %{REQUEST_FILENAME} !-f Code: RewriteCond $1 !^(index\.php|public|images|tmp|robots\.txt|css) Code: deny from all Mod Rewrite works if site is in a sub directory but not in the root - El Forum - 05-06-2009 [eluser]Ty Bex[/eluser] SOLVED - Read next post for solution.. Mod Rewrite works if site is in a sub directory but not in the root - El Forum - 05-06-2009 [eluser]Ty Bex[/eluser] [quote author="Daniel Moore" date="1241591372"]For a complete walk-through of a good .htaccess, visit: http://www.danielwmoore.com/remove_index_from_codeigniter My first suggestion is to change: Code: RewriteRule ^(.*)$ index.php/$1 [L] to: Code: RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA] The above referenced link should tell you why if you read through it all. This may very well fix the situation you are experiencing. [/quote] It tuned out being the line with the ? after the index.php Code: RewriteRule ^(.*)$ index.php?/$1 [NC,L,QSA] Thank you very much and excellent file with a great description. I have been lookiing for a good description file.. |