Link to home
Start Free TrialLog in
Avatar of Neil_Bradley
Neil_BradleyFlag for New Zealand

asked on

arked domain redirect

I am attempting to use an htaccess file to
1. re direct a parked domain to a subdirectory
2. Mask the url so that instead of showing this: www.primaryDomain.com/myParkedDomainSubdirectory/
only the parked domains name shows (ie www.myParkedDomain.com instead of www.primaryDomain.com/myParkedDomainSubdirectory/)
Can anyone show me best practice to achieve this on an Apache server?
The code attached is what I have so far..
Cheers,
N
RewriteRule ^parked-directory - [L]
RewriteCond %{HTTP_HOST} ^(www\.)?myParkedDomain\.com$ [NC]
RewriteRule ^(.*)$myParkedDomainSubdirectory/$1 [L]

Open in new window

Avatar of Michael Worsham
Michael Worsham
Flag of United States of America image

mod_rewrite won't be able to 'mask' the domain name. You will have to use mod_proxy capabilities for that.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?myParkedDomain\.com$ [NC]
RewriteRule ^(.*) http://mysite.com/domains/$myParkedDomainSubdirectory/$1 [P,L]

Open in new window

Avatar of Neil_Bradley

ASKER

Or have it as an add on domain as opposed to a parked domain?
N
I don't understand the question you are asking.
ASKER CERTIFIED SOLUTION
Avatar of Linux Guru
Linux Guru
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great answer and many thanks for your help.
Cheers,
Neil
No problem. You are always welcome :)