0

Part 1: How do I get people visiting my blog with http://example.com/archives/14073 redirect to http://example.com/?p=14073.

Part 2: What about when the incoming link is like this: http://example.com/archives/14073?utm_campaign=Foo&utm_source=foo.com&utm_medium=email

0

This solved both parts:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^archives/(.*)$ /\?p=$1 [R=301,L,QSA]
</IfModule>

The QSA flag maintained the query string automagically.

Most importantly, I had to put it above the existing WordPress rewrite rules in order for it to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.