
Originally Posted by
office7
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^[(html|articles)]/articlename\.html$ http://www.businessperform.com/articles/newdir/articlename.html [R=301,L]
articlename.html and /newdir/ will be different for each of our articles and the last line is repeated for each articlename.html. I'm hoping this will redirect url requests for articles in our /html/ and our /articles/ directories to the new position in /articles/newdir/
The directives which you specified will probably not perform as you would want... try these:
Code:
RewriteEngine on
# /html/* and /articles/* => /articles/newdir/*
RewriteCond %{REQUEST_URI} ^/(html|articles)/ [NC]
RewriteRule (html|articles)(.*) http://www.businessperform.com/articles/newdir$2 [R=301,L]
# Host rewrite (non-www => www)
RewriteCond %{HTTP_HOST} !^www\.businessperform\.com [NC]
RewriteRule .? http://www.businessperform.com%{REQUEST_URI} [R=301,L]