Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Domain Directing

Discussion in 'General Discussion' started by 1webguru, Oct 17, 2003.

  1. 1webguru

    1webguru Registered

    Oct 17, 2003
    Likes Received:
    Trophy Points:
    I have 2 domain, a and b. Domain A points to /directory1/ and works fine. I want to add a second domina (domian b) and point it to a subdirectory of Domain A.. such as /directory1/sub1/ . I knkow how to do this in WebMin, by editingthe Apache httpd file. How do I do it in Cpanel?
  2. mickeymouse

    mickeymouse Well-Known Member

    Sep 16, 2003
    Likes Received:
    Trophy Points:
    Dear 1webguru,

    For redirecting a domain to a subfolder the normal procedure is editing the .htaccess file.

    Add the following to the .htaccess file:

    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 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 and to the directory specified.

    You can edit the .htaccess file at cpanel-> filemanager option in cpanel.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice