homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

mod rewrite subdomain1 to sundomain2

5+ Year Member

Msg#: 4187466 posted 1:15 am on Aug 16, 2010 (gmt 0)

Hi all,

I'd like to redirect any requests from one subdomain to another, basically just replacing the sundomain1 part of the URL with subdomain2


If a user tries to access

It will direct them to

Any help would be appreciated.

Thank you



Msg#: 4187466 posted 1:04 pm on Aug 16, 2010 (gmt 0)
Here is an example i use to rewrite *.domain.com to www.domain.com.

RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.domain.com/$1 [L,R=301,NE]
Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved