Reputation: 25
I don't know much about .htaccess, but I'm trying to help a friend who recently moved his blog to Wordpress.
We need to redirect the OLD archive pages like this:
Thanks so much for your help, Amanda
OK tried this:
RewriteEngine On RewriteRule ^([0-9]{4})([0-9]{2})([0-9]{2})_archive.html$ /$1/$2/$3 [L,R=301]
in .htaccess in the very top level folder of my site. Still, when I go to http://www.bikermetric.com/2010_04_01_archive.html, it doesn't redirect.
Just tried this too: RedirectMatch 301 ^/([0-9]{4})([0-9]{2})([0-9]{2})_archive.html$ /$1/$2/$3
Still nothing.
Upvotes: 1
Views: 760
Reputation: 143966
You can use mod_alias or mod_rewrite here. You'll want to stick with using mod_rewrite if you already have rewrite rules (stuff that look like RewriteEngine
or RewriteRule
):
mod_alias:
RedirectMatch 301 ^/([0-9]{4})_([0-9]{2})_([0-9]{2})_archive.html$ /$1/$2/$3
mod_rewrite:
RewriteEngine On
RewriteRule ^([0-9]{4})_([0-9]{2})_([0-9]{2})_archive.html$ /$1/$2/$3 [L,R=301]
You'd want to add it to the htaccess file in your document root.
Upvotes: 2