Welcome to WebmasterWorld Guest from 54.162.141.212

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

non-www to www WITH subdomains

need help with correct configuration

     
7:40 am on Jun 27, 2013 (gmt 0)

10+ Year Member



I am using the following for non-www to www on my sites :


RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


I want to add a subdomain such as blog.example.com. I have two issues to figure out :

1 - Exclude the subdomain from the above rewrite as it currently rewrites blog.example.com to example.com/blog/

2 - The actual subdomain location is /blog/, but that should never be accessible to people or engines. So, /blog/* should always be blog.example.com/*

I'm guessing this is a pretty common thing, but I have not used subdomains in ages. Any recommendations would be great... I would like to keep the original rewrite intact since it is the most complete non-www to www I was able to come across to date.

thanks
10:40 am on Jun 27, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



this thread describes a similar situation to yours.

rewrite subdomain to folder:
http://www.webmasterworld.com/apache/3404559.htm [webmasterworld.com]
12:15 pm on Jun 27, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



please see further discussion in this duplicate thread.

non-www to www WITH subdomains - Apache Web Server forum:
http://www.webmasterworld.com/apache/4588079.htm [webmasterworld.com]
 

Featured Threads

Hot Threads This Week

Hot Threads This Month