I have this in my htaccess and most of the time it works fine but every now and then I seem to get a loop - any ideas what is wrong
its doing rewrite to hhtps, friendly URLS, match to links from old site and error pages
is there a condition that is not exiting?
(also I'm not sure if I need the RewriteBase entry)
(index.php is my controller)
- Code: Select all
RewriteEngine on
RewriteBase /
Options +FollowSymlinks
Options All -Indexes
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteRule ^Agencies/([^/]+)/([^/]+)/(.*)$ index.php?sector=2&pg=$2&qs=$3 [NC,L]
RewriteRule ^Agencies/([^/]+)/(.*)$ index.php?sector=2&pg=$2 [NC,L]
RewriteRule ^Agencies/(.*)$ index.php?sector=2&pg=$1 [NC,L]
RewriteRule ^Agencies$ index.php?sector=2 [NC,L]
RewriteRule ^Agency$ index.php?sector=2 [NC,L]
RewriteRule ^Providers/([^/]+)/([^/]+)/(.*)$ index.php?sector=4&pg=$2&qs=$3 [NC,L]
RewriteRule ^Providers/([^/]+)/(.*)$ index.php?sector=4&pg=$2 [NC,L]
RewriteRule ^Providers/(.*)$ index.php?sector=4&pg=$1 [NC,L]
RewriteRule ^Providers$ index.php?sector=4 [NC,L]
RewriteRule ^Provider$ index.php?sector=4 [NC,L]
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php
I'd also like to protect one single file (securefile.php) with a password required to access it
is that easy to add ?
I've only proteced directories before..
thanks