Re: mod_rewrite problem

From: Date: Thu, 18 Jul 2002 16:15:51 +0000
Subject: Re: mod_rewrite problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108284@lists.php.net to get a copy of this message
Adrian Murphy wrote:
Hi, the following code redirects www.usersite.mysite.biz to www.mysite.biz/users/sites/usersite the problem is when the 'www' is left out it doesn't work. could someone help me to fix this? many thanks RewriteEngine on
RewriteCond   %{HTTP_HOST}                 ^www\.[^.]+\.mysite\.biz$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule ^www\.([^.]+)\.mysite\.biz(.*) http://www.mysite.biz/users/sites/$1
RewriteCond   %{HTTP_HOST}                 ^www\.[^.]+\.mysite\.ie$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule ^www\.([^.]+)\.mysite\.ie(.*) http://www.mysite.biz/users/sites/$1 adrian.
Hi, According to your rewrites the following line makes no sense RewriteRule ^(.+) %{HTTP_HOST}$1 [C] so remove it....this does not solve your problem also modify your rewrite conds to read ^(www\.)?[^.]+mysite\.biz$ This also applies to www.username.mysite.ie Regards -- Sameh Attia Senior System Engineer T.E. Data -- __ __ _ _________ _/ /_/ /_(_)___ _ / ___/ __ / __/ __/ / __ / (__ ) /_/ / /_/ /_/ / /_/ / /____/\__,_/\__/\__/_/\__,_/

« previous php.general (#108284) next »