Redirection, preserving variables, changing path

Discuss practical ways rearrange URLs using mod_rewrite.

Redirection, preserving variables, changing path

Postby stuarta » Thu Sep 09, 2004 8:30 am

Hello,
I would like to redirect everything under the partys/* folders to be under /results.php but preserving all the variables, e.g.:

http://mysite.com/partys/foo/?par1=foo& ... r&par3=moo to http://mysite.com/results.php?par1=foo& ... r&par3=moo

and...

http://mysite.com/partys/bar/?par1=foo& ... r&par3=moo to http://mysite.com/results.php?par1=foo& ... r&par3=moo

Basically I just need to throw away the partys directory and any subdirs and do the redirect....

Any ideas?
stuarta
 
Posts: 6
Joined: Fri May 14, 2004 12:21 am

Postby seomike » Thu Sep 09, 2004 9:03 am

RewriteCond /partys/.*$
RewriteRule ^partys/.*$ /results.php?%{QUERY_STRING} [R]

try that
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 14 guests

cron