Josee Barrette
Josee Barrette

Reputation: 21

need to redirect multiple urls through htaccess

I am working on updating a wordpress installation and permanently changing the urls. For the posts, a simple redirection in htaccess will do, but there is a calendar module, with events that repeat, and I am not sure how to deal with that in htaccess.

I need to go from

http://www.gamekeeper.ca/blog/ai1ec_event/dimanche-yu-gi-oh/?instance_id=61243

to

http://www.gamekeeper.ca/ai1ec_event/dimanche-yu-gi-oh/?instance_id=61243

for al the events.

How should I proceed to make a global redirection?

Thank yo for your help!

Upvotes: 1

Views: 54

Answers (1)

OscarJ
OscarJ

Reputation: 413

Use a RedirectMatch directive as follows:

RedirectMatch 301 ^/blog/ai1ec_event/(.*) http://www.gamekeeper.ca/ai1ec_event/$1

Note that the status code 301 makes this a permanent redirect, i.e. it will be cached by proxies and browsers. You'll probably want to use 302 (temporary redirect) until you are sure that everything works as intended.

More info at: http://httpd.apache.org/docs/2.2/mod/mod_alias.html#RedirectMatch

Upvotes: 1

Related Questions