[PHP] Re: mod_rewrite problem

2002-07-18 Thread Sameh Attia

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 itthis 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
--
__  __  _
_ _/ /_/ /_(_)___ _
   / ___/ __ `/ __/ __/ / __ `/
  (__  ) /_/ / /_/ /_/ / /_/ /
//\__,_/\__/\__/_/\__,_/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: mod_rewrite problem

2002-07-18 Thread CC Zona

In article <003d01c22e58$dcb45240$6601a8c0@yourwrjlo8t8dt>,
 [EMAIL PROTECTED] (Adrian Murphy) wrote:

> 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.

> 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

Change each of those instances of "^www\." to "^(www\.)?"

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php