• So I’m phasing out a cgi script and replacing it with a php file. But I’d like old links to work, so I’m trying to use a rewriterule to direct to the php file.
    Now, I can easily enough redirect /cgi-bin/list.cgi?5&2 to /hp/index.php?5&2.
    But I don’t want to do that. I’m replacing one cgi script with several php scripts, and which php script I want depends on what the first paremeter was. For example, I want /cgi-bin/list.cgi?1&2 to redirect to /gutter/index.php?2 and /cgi-bin/list.cgi?2&2 to redirect to /tars/index.php?2.
    This is what I’ve tried, but I must be getting the regular expression wrong in some way.
    RewriteBase /cgi-bin/
    RewriteRule ^list2.cgi?5&(.*) /hp/index.php?$1 [R]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘rewriterule and reg. expressions’ is closed to new replies.