Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Addon domains! Is there any sense on it on Apache?


galench - 12:57 pm on Mar 21, 2008 (gmt 0)


Well i found some decision.

It`s necessary to add rule in to the htaccess file of addon_folder:

RewriteEngine on
#Redirecting from addon folder to example.com if request`s from http://www.example.com на example.com
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

#Redirecting from addon folder to example.com if request`s from http://example.com на example.com
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

#Redirecting from subdomain (addon) -
http://addon_folder.example.com на example.com
RewriteCond %{HTTP_HOST} ^addon_folder.example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addon_folder.example.com$
RewriteRule ^(.*)$ http://www.example.com [R=301,L]

Unfortunaly, there`s some nuance:
1. If request from http://example.com/addon_folder -
without "/" in the end it redirects
http://example.com//home/example/public_html/addon_folder -
404 (page not found)

2. If request to subfolder of addon_folder -
http://example.com/addon_folder/folder2 redirects
http://example.com/folder2/

But what code don`t give possibility to view addon folders content from main domain!

[edited by: jdMorgan at 4:37 pm (utc) on Mar. 22, 2008]
[edit reason] de-linked [/edit]


Thread source:: http://www.webmasterworld.com/apache/3607140.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com