httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blanco <david.bla...@publicinet.net>
Subject Re: [users@httpd] Redirect URLs using mod_rewrite
Date Thu, 28 Dec 2006 15:21:44 GMT
Hi!

Stefan Antonelli escribió:

> i would like to use apaches mod_rewrite to redirect some URLs to its new
> Location. I have to change this:
> 
> http://www.doamin.de/subdir/foo.php?id=1234
> 
> into this:
> 
> http://www.domain.de/subdir/bar.php?newid=1234#sameid1234
> 
> I've tried out this and a lot of variants but none of them worked for me:

Are you sure that mod_rewrite is working (RewriteEngine On)?

> RewriteRule ^/subdir/foo.php\?id=(.*) /subdir/bar.php?newid=$1#sameid$1 [R]
> 
> Any suggestions for me?

Take a look at the RewriteBase directive in the mod_rewrite docs

Try something like this:

> RewriteBase /subdir
> RewriteRule foo\.php\?id=([0-9]+)$ bar.php?newid=$1#sameid$1

Hope this helps...


Greetings

-- 
David Blanco - Programación y sistemas
Publicinet (Publicidad-Cine-Internet, S.L.)
Urzaiz, 71, entlo, izda. -- 36204 Vigo
Telf 902.014.606 -- http://www.publicinet.net



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