Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- 301 Redirect subdomain to folder


stu2 - 11:32 pm on Jun 24, 2010 (gmt 0)


Still every subdomain is being redirected to another domain on my host. Here is my .htaccess file...

<Files .htaccess>
Deny from all
</Files>

ErrorDocument 404 http:// www.mydomain.us/error404.php

RewriteEngine On

# Internally rewrite requests for forums subdomain to /forum subdirectory filepath
RewriteCond $1 !^forums/
RewriteCond %{HTTP_HOST} ^forums\.mydomain.us
RewriteRule ^(.*)$ /forum/$1 [R=301,L]

and here is the .htaccess file from my root directory on the host..

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName myhostname.com
AuthUserFile /home/myhostname/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/myhostname/public_html/_vti_pvt/service.grp

And here is .htaccess from the domain being passed to..

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]


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