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
https://forums.phpfreaks.com/topic/183206-htaccess-for-addon/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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