Redirect Main domain not sub domain.
Hi, completely new her, wonder if anyone can help with the following problem.
I run my website domain.com on wordpress hosted by westhost.
I would like to point the main domain to Photo Deck the company who hosts my image gallery etc.
(Now under a sub domain archive.domain.com/)
And then I like to run my wordpress under a sub domain: blog.domain.com
Somehow I have to redirect the sub domain blog.domain.com and point it to the public_html and redirect domain.com to sites.photodeck.com.
But how do I go about it? Any help would be appreciated.
David
-
Did you try via cPanel-> Redirects ? Ask your hosting company for some help. 0 -
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 -
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 -
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 -
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.
Comments
5 comments