Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    1

    Default Domain Directing

    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. #2
    Member
    Join Date
    Sep 2003
    Posts
    389

    Default RE: Domain Directing

    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 .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.

    Regards,

Similar Threads & Tags
Similar threads

  1. Main Shared IP Directing to A Hosted Domain
    By humba in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-07-2009, 11:45 AM
  2. Re-directing from a non-existent subdomain?
    By niya in forum New User Questions
    Replies: 3
    Last Post: 03-28-2007, 10:48 AM
  3. Domain forwarding/parking or directing domains
    By miltonponson in forum New User Questions
    Replies: 2
    Last Post: 09-29-2006, 08:02 AM
  4. directing incoming and outgoing mails of a domain to a mailbox
    By lawrence.dcosta in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-26-2006, 11:45 AM
  5. directing a new domain to a file on current domains hosting
    By spike326 in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 03-12-2004, 11:12 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube