rugbyjack2005
Power Member
- Oct 2, 2011
- 539
- 50
I have a new client that has recently moved their site to a new domain. While they have transferred most of their site to the new domain, they still have an application running on the old domain. This application has a login box with a bit of code in the .htaccess - see below:
AuthUserFile /folder/folder/auth/.htpasswd1
AuthGroupFile /dev/null
AuthName "Private"
AuthType Basic
require valid-user
Now i want to redirect the old site to the new site but with an exception that allows the application to still run on the old site. This is where i have got to so far but I am struggling with the exception part:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
AuthUserFile /folder/folder/auth/.htpasswd1
AuthGroupFile /dev/null
AuthName "Private"
AuthType Basic
require valid-user
These two codes work individually but not together as i am missing the bit of exception code. Can someone fill in the missing bit of exception code please?
Thanks add rep will naturally be given to useful comments.
AuthUserFile /folder/folder/auth/.htpasswd1
AuthGroupFile /dev/null
AuthName "Private"
AuthType Basic
require valid-user
Now i want to redirect the old site to the new site but with an exception that allows the application to still run on the old site. This is where i have got to so far but I am struggling with the exception part:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
AuthUserFile /folder/folder/auth/.htpasswd1
AuthGroupFile /dev/null
AuthName "Private"
AuthType Basic
require valid-user
These two codes work individually but not together as i am missing the bit of exception code. Can someone fill in the missing bit of exception code please?
Thanks add rep will naturally be given to useful comments.