Forum Moderators: phranque
RewriteCond %{REQUEST_URI} ^/p40_articleid/[^/]+$
RewriteRule ^newsid/(.*)$ [L,QSA,R=301] Options All -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/p40_articleid/[^/]+$
RewriteRule ^newsid/(.*)$ [L,QSA,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
RewriteCond you specify the request must begin with p40_articleid but in the RewriteRule you specify the request must begin with newsid. news/" so the rule can never run while the ^ "begins with" marker is present, or while news/ is missing from the pattern. RewriteRule ^news/p40_articleid/([^/]+)$ http://www.example.com/news/newsid/$1 [R=301,L]