Forum Moderators: phranque

Message Too Old, No Replies

RedirectMatch escape char

Need to redirect to main.pl?$1

         

colphax

10:42 pm on Jan 29, 2006 (gmt 0)



I've got a problem with a RedirectMatch .htaccess string.

I'm trying to make
www.vidblogs.com/username
redirect to
www.vidblogs.com/cgi-bin/main.pl?username
but the? I need is encoded and instead it redirects to
www.vidblogs.com/cgi-bin/main.pl%3fusername

My code is:

RedirectMatch ^/([^about.*¦style.*¦image.*¦index.*¦cgi.*¦forums.*¦signup.*].*)$ /cgi-bin/main.pl?$1

The extra terms in the regular expression are to avoid matching files in the root that I need.

Is there a way to do this with RewriteRule that won't encode the question mark?

jdMorgan

11:03 pm on Jan 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



colphax,

Welcome to WebmasterWorld!

If you adapt your code to mod_rewrite, the question mark should be passed through unchanged. You can also choose between doing an external redirect, which publishes your dynamic URL, or doing an internal server rewrite which simply passes the request to your script. This depends on the RewriteRule syntax you choose.

Jim