My hosting account (cpanel) is setup with the full domain (modrewrite.com), onto which I have parked local versions (modrewrite.co.uk) and a shortened version (modrw.com).
I have the following htaccess in the root to rewrite all traffic to the short version (including the www): -
- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.modrw\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.modrw.com/$1 [L,R=301]
This is working fine. However, I have an htaccess protected /admin folder which stopped working when I started using the above mod_rewrite code in the root.
It seems that no matter which domain I access the /admin folder from, upon authentication it gets rewritten to the full "account" domain version (modrewrite.com/admin), which is causing a 404 error (I'm assuming because this is in conflict with the mod_rewrite in the root).
Changing the host account domain to the short version is not an option as too many things are tied to it.
I need to disable mod_rewrite in the admin folder, either by an htaccess file in it or (preferably) by an entry in the htaccess of the root to ignore the admin folder. The trouble is I don't know how to do either?
Any help would be much appreciated!