views:

421

answers:

2

How do You do a re-direct a group of pages with a wildcard that doesn't attach the variables at the end? For example, the .htaccess code below:

RedirectMatch 301 /general/old_events_page.php(.*) http://mysite.org/events

Yields this:

mysite.org/events?id=749&friendly=1&date=20090308

But I just want it to go to http://mysite.org/events

A: 

You'll need to use RewriteCond + RewriteRule to achieve this.

RewriteCond evaluates the conditions for which the rule applies

RewriteRule is the rule itself

Anyway... This should the trick;

RewriteEngine on
RewriteCond %{REQUEST_URI} /general/old_events_page.php
RewriteRule .? /events$1? [R=301,L]
MatW
A: 

Try this mod_rewrite rule:

RewriteEngine on
RewriteRule ^general/old_events_page\.php$ /events? [L,R=301]
Gumbo