rewrite all subdomains on apache server

New to mod_rewrite? This is a good place to start.

rewrite all subdomains on apache server

Postby DJ » Wed Jan 21, 2004 9:01 am

Hello,

I want to rewrite all the subdomains on my server to a new url. It should be mail.domain.com going to www.domain.com

I already tried this:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^mail.([^/])$
RewriteRule ^/ http://www.domain.com/ [L,R]

Does anybody know how to do this? And remember that it should work for all the domains, I want to add some rules just once, not everytime a new domain is added

best regards

DJ
DJ
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 24 guests

cron