httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "--[ UxBoD ]--" <ux...@splatnix.net>
Subject Re: [users@httpd] Help with simple mod_rewrite
Date Sat, 07 May 2011 23:18:04 GMT
----- Original Message -----
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
>   I thought that this little URL rewrite would be oh-so-simple. I
>   have
> not gotten it to work; it is completely ignored.
>   I wish to redirect any URL <http://fb.example.com/*> to
> <http://example.com/*?fb=1>.
> 
>   In <.htaccess>:
> RewriteEngine on
> RewriteRule ^/(.*)  http://example.com/$1?fb=1 [R,L]
> 
>   Where did I go wrong?
> 

How about:
RewriteCond %{HTTP_HOST} = fb.example.com
RewriteRule ^ http://example.com%{REQUEST_URI}?fb=1 [R=301,L]
-- 
Thanks, Phil

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