views:

48

answers:

1

I've been fighting this for a while and can't seem to make it work. My old system used a lot of query strings to render pages but they are no longer necessary. My url is below:

  • OLD URL: www.example.com/links.php?section=5&catid=52
  • NEW URL: www.example.com/mhfs/links

The name links is coincidental and not necessarily from the old pages name. I need to check which section and catid is present and redirect them to the appropriate page from what it is. I tried the following but this just seems to do nothing. What am I doing wrong?

RewriteCond %{REQUEST_URI} ^links.php$
RewriteCond %{QUERY_STRING} ^section=5$
RewriteCond %{QUERY_STRING} ^catid=52$
RewriteRule ^(.*)$ /mhfs/links? [R=301]

Any help would be GREATLY appreciated.

A: 

You must turn the rewrite engine on for it to work. You probably don't want the regex start symbol on the replacement:

RewriteEngine on

RewriteCond ...

RewriteRule ...

SamGoody
Sorry.. I knew I'd forget to add some details. I have a lot of other rules running on this file so I have the rewrite engine on, but it seems to be when I get to multiple variables that nothing I do is working.
Chad