WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My ht access includes:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/preview/(.*)\-[0-9]+$
RewriteRule ^/preview/(.*)\-[0-9]+$ /$1 [R=301,L]

but still when I try to access something such as:


it doesn't redirect (where http://sg.wyli.co.uk/coronation-street-the-mystery-of-the-missing-hotpot-recipe will work...)

im using a plugin: Wp htaccess Control to add the rule, so it's definitely being added to the wordpress rewrite rule system, but it's not having any effect?

are there any more wordpress quirks I need to avoid? Is there a basic error I'm missing?

share|improve this question
Try it witout starting / in your rules and a line RewriteBase / after RewriteEngine on. And why the condition? – Raphael Jan 20 '12 at 17:31
up vote 0 down vote accepted

Sooo the problem was my brackets around the content in the condition I think.

I'm still not so hot on these things, but I use these rules and they work:

RewriteCond %{REQUEST_URI} ^/(review|preview|feature).*\-[0-9]+$
RewriteRule ^review/(.*)\-[0-9]+$ /$1 [R=301,L]
RewriteRule ^preview/(.*)\-[0-9]+$ /$1 [R=301,L]
RewriteRule ^feature/(.*)\-[0-9]+$ /$1 [R=301,L]

note: the (review|preview|feature) but is an x OR y OR z, as I have the rule working for any of those folders specifically.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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