0

I'm trying to redirect URLs to a cgi script that match certain criteria. I.e. I don't want to redirect every query to that script, just those with a particular parameter. But I can't get it to work. Here's my Redirect:

RedirectMatch /cgi-bin/Pwebrecon.cgi?BBID=(.*) http://adelaide.hosted.exlibrisgroup.com:1701/primo_library/libweb/action/dlDisplay.do?vid=SUA\&docId=SUA$1

I've used RedirectMatch successfully many, many times, but never before with a cgi script. Anyone know how to make this work?

Laurent CAPRANI
  • 139
  • 2
  • 10
Steve Thomas
  • 328
  • 2
  • 7

1 Answers1

0

mod_alias only deals with the path part of the URL, not the query.

The directive below will redirect http://example.com/old.html?name=value to http://example.com/new.html?name=value. The $ marks the end of the path, not the end of the URL.

RedirectMatch permanent ^/old\.html$ /new.html

mod_rewrite is necessary to deal with (that is, rewrite) queries.

Laurent CAPRANI
  • 139
  • 2
  • 10