[thelist] mod rewriting question

Stephen Rider evolt_org at striderweb.com
Tue May 15 09:41:19 CDT 2007

On May 15, 2007, at 7:56 AM, Tom Dell'Aringa wrote:

> The old URL
> http://www.crossandthrone.com/2005/01/01/happy-new-year/
> Needs to be 301 redirected to:
> http://www.crossandthrone.com/articles/happy-new-year/

Try something like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(0-9){4}/(0-9){2}/(0-9){2}/(.+?)/?$ /archives/$4/ [R=301,L]

This entire block should go _before_ whatever rewrite block your CMS/ 
blog has as default.

More information about the thelist mailing list