httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] Mod_rewrite help
Date Thu, 17 Apr 2003 21:35:27 GMT

On Thu, 17 Apr 2003, Peter Ferrigan wrote:
> Pretty much like this:
>
> Hostname.olddomain.com
>
> Needs to go to
>
> Hostname.newdomain.com
>
> I've tried redirects, but that doesn't take into account any directory
> that the user may have typed in.

Uhhh... Yes they do.

> To add to this mess, I've also got Virtual hosts, but they all have the
> same domain name.  ie:
>
> Host1.domain.com
> Host2.domain.com
> Etc..

RewriteEngine On
RewriteCond %{HTTP_HOST} ([a-z]*)\.olddomain\.com$ [NC]
RerwiteRule ^/(.*) http://%1.newdomain.com/$1

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message