I have a site with old links around the web like this http://www.domain.com/blog/archives/990 and this http://domain.com/blog/archives/990 I need htaccess code to rewrite those old links, both those with and without www, as http://www.domain.com/blog/?p=990 Triggers for the rewrite are the URL's must contain /archives/ and the section after /archives/ must be the last section in URL and must be numeric. That numeric section can be any # of digits long. thank you
i think about something like this: RewriteBase / RewriteRule ^.*/archives/(\d+)$ blog/?p=$1 [NC,R=301] RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [NC,R=301]