Page is a not externally linkable
galench - 1:57 pm on Mar 26, 2008 (gmt 0)
RewriteCond %{HTTP_HOST} ^.*$ RewriteCond %{HTTP_HOST} ^.*$ RewriteCond %{HTTP_HOST} ^example\.com$ [NC] But in addon domain it`s not working! 2. Sorry jdMorgan! Maybe i stupid, but this code doesn`t work in htaccess file in main folder: RewriteCond %{HTTP_HOST} ^.*$ RewriteCond %{HTTP_HOST} ^.*$ RewriteCond %{HTTP_HOST} ^.*$ RewriteCond %{HTTP_HOST} ^.*$
1.
Your links are defined by the code on the page, or the code that produces the page. Mod_rewrite cannot change your code, so you must change your code.
Don`t know, but i have this code in main domain, and it`s works fine:
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ http://www.example.com/mainsite/index.php [R=301,L]
RewriteRule ^index.htm$ http://www.example.com/mainsite/index.php [R=301,L]
RewriteRule ^index.html$ http://www.example.com/mainsite/index.php [R=301,L]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Maybe because it`s redirecting first from main folder to http://www.example.com/mainsite/index.php
But it`s works fine!
RewriteCond %{HTTP_HOST} ^addon-domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.addon-domain.com/$1 [L,R=301]
# If direct client request for www.example.com/addon or example.com/addon, redirect back to example.com domain
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /addon/?
RewriteRule ^addon/?(.*)$ http://example.com/$1 [R=301,L]
This why i aded these lines:
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^400.shtml$ http://www.example.com [R=301,L]
RewriteRule ^401.shtml$ http://www.example.com [R=301,L]
RewriteRule ^403.shtml$ http://www.example.com [R=301,L]
RewriteRule ^404.shtml$ http://www.example.com [R=301,L]
RewriteRule ^500.shtml$ http://www.example.com [R=301,L]