Welcome Guest, Not a member yet? Register   Sign In
htaccess and accessing folders
#1

[eluser]HooJee[/eluser]
Hi Guys

I have enabled mod rewrite and added the following code to my htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

The problem is I have a public folder in the root dir which has all the CSS,images etc - I cannot access it. Does anyone know how I can fix this ?
#2

[eluser]Dam1an[/eluser]
You need to either add the name of the directory to the rewrite condition, so it becomes
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|public)
RewriteRule ^(.*)$ /index.php/$1 [L]
or change it so anything which doesn;t match a file goes through index.php
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]




Theme © iAndrew 2016 - Forum software by © MyBB