Skip to main content

Redirect Main domain not sub domain.

Comments

5 comments

  • PlotHost
    Did you try via cPanel-> Redirects ? Ask your hosting company for some help.
    0
  • DBleeker
    I can redirect the main domain that is not the problem. But the destination for the redirection of the sub domain must begin with a protocol, e.g., http:// and I want to redirect to the public_html directory of the site.
    0
  • DBleeker
    It seems that I have to manually change the .htaccess file. As this way beyond my comfort zone I wonder if anyone can tell me if this is right. That is what I understand from this thread: http://forums.cpanel.net/f34/redirect-main-domain-but-not-subdomain-221272.html Current .htaccess file: *********************** RewriteOptions inherit # WestHost 4.0 Custom php.ini SetEnv PHPRC /home/davidble/public_html/php.ini # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] ************************ would have to change: ************************ root@host [/home/davidble/public_html]# cat .htaccess RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.domain\.com$ RewriteRule ^/?$ "http\:\/\/sites.photodeck.com" [R=302,L] *********************** But I am not sure which part exactly I have to replace?
    0
  • cPanelMichael
    Hello :) You can modify the document root value for the subdomain by editing the "documentroot" entry in the appropriate cPanel user data file: /var/cpanel/userdata/$username/$sub.domain.com
    Then, rebuild the Apache configuration file via: /scripts/rebuildhttpdconf
    Thank you.
    0
  • DBleeker
    Sorry that goes over my head. I can edit the .htaccess file but I am really looking for confirmation that the code is right???
    0

Please sign in to leave a comment.