Jump to content

htaccess for addon


mraza

Recommended Posts

hi my question is i have a site ie. maindomain.com and my host allow 10 add-on domains. so i buy another domain and created through cpanel. now i have another directory in my root directory ie addondomain.net . I have all the files of my main domain in my root directory now this would be second domain. and i was thinking about how its SEO will effect. i try to search and found if i add these lines of code in .htaccess file of my root directory it would help:

 

this code i made a new file .htaccess and saved in root/addondomain directory

Options +FollowSymlinks
RewriteEngine OnRewriteCond %{HTTP_HOST} ^addondomain\.net [NC]
RewriteRule ^(.*) http://www.addondomain.net/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www.addondomain.maindomain\.com
RewriteRule ^(.*)$ http://www.addondomain.net/$1 [R=permanent,L]

RewriteCond %{HTTP_HOST} ^addondomain.maindomain\.com
RewriteRule ^(.*)$ http://www.addondomain.net/$1 [R=permanent,L]

 

And added this to the .htaccess file in the root domain: ie. maindomain.com/

Options +FollowSymlinks
RewriteEngine OnRedirect /addondomain http://www.addondomain.net

So now problem is i will get 500 Internal Error if i will use these lines of codes. Please any help. Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.