one hosting 2 domains one being password protected.

Using a single web hosting account to host multiple sites

one hosting 2 domains one being password protected.

Postby create.tistiy » Fri May 29, 2009 11:29 am

I have one hosting account on

domain1.com

then on

domain1.com i have a folder

domain1.com/folder


I want domain2.com to mask domain1.com/folder and show only domain2.com in the url bar

this works fine but it shows the page then asked for the passwords (Im using .htpasswd).. i might need to wait longer for the changes to take effect... does the below code look okay for what i need...
Code: Select all
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/folder%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com$ [NC]
RewriteRule ^(.*)$ /folder/$1 [QSA,L]



Thanks in advance for your help....
create.tistiy
 
Posts: 4
Joined: Fri May 29, 2009 9:17 am

Postby richardk » Sat May 30, 2009 9:43 am

The mod_rewrite is fine.
Is the password protection in /folder/.htaccess?
Has it sorted itself out?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 1 guest

cron