Welcome Guest, Not a member yet? Register   Sign In
Mod Rewrite works if site is in a sub directory but not in the root
#3

[eluser]Daniel Moore[/eluser]
For a complete walk-through of a good .htaccess, visit:
http://www.danielwmoore.com/remove_index...odeigniter

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
RewriteCond %{REQUEST_FILENAME} !-d
and
Code:
RewriteCond $1 !^(index\.php|public|images|tmp|robots\.txt|css)
are redundant. Use one or the other, but not both. I recommend the first one. If you have directories that you do not want accessed, as you are indicating by "public|images|tmp|css" and you do not want these accessed directly, then simply place a .htaccess file in each directory you wish to deny access to, with a single line in the .htaccess file as follows:
Code:
deny from all


Messages In This Thread
Mod Rewrite works if site is in a sub directory but not in the root - by El Forum - 05-05-2009, 07:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB