Knowledgebase
How do I park a domain on a sub-directory?
Posted by Michael Sasek (Import) on 23 February 2008 03:02 AM
First, in CPANEL, park the domain on your account.
 
Next, add this to your .htaccess file in your public_html dir. Remeber to replace www.domain. with your actual domains. 
 
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.domain.*
RewriteCond %{REQUEST_URI} !/subdir/
RewriteRule ^(.*)$ /subdir/$1
RewriteCond %{HTTP_HOST} ^domain.*
RewriteCond %{REQUEST_URI} !/subdir/
RewriteRule ^(.*)$ /subdir/$1


Replace www.domain.* (4th line) and domain.* (7th line) with the actual domain name of the pointer (minus the \'www.\' in the second instance). Do not put .com or .co.uk on it; keep the asterisk. Also replace the four instances of \"subdir\" with the subdirectory on YOUR site that domain pointer will map to.

This will redirect requests for the domain pointer (both domain.com and www.domain.com) to the directory specified.

You can edit the .htaccess file at cpanel-> filemanager option in cpanel.
(0 vote(s))
Helpful
Not helpful

Comments (0)