Forum Moderators: phranque
I'm working on an x-cart project and currently have an seo plug in installed however I think it may be conflicting with trying to re-direct the old asp urls to the new php urls. I'm racking my brain over why the below isn't working. The below won't redirect the old asp url to the new php url it will just bring up a page not found at the old asp url.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(payment地dmin如rovider如artner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif夸pe?g如ng夸s圭ss存wf如hp夷co)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ cdseopro.php
RewriteCond %{QUERY_STRING} &?ID=50&?
RewriteRule ^aboutus_articles.\.asp$ [exampleurl.com...] [R=301,L]
Any help is greatly appreciated. Thanks!
The first rule will therefore rewrite requests for "aboutus_articles.asp" URL-paths to cdseopro.php, which the second rule will not redirect because it no longer matches the second rule's pattern.
Your first rule is also missing an [L] flag, which I recommend in all cases unless you *know* why you wish to omit it.
In general, order your rules with all external redirects first, in order from most-specific patterns and conditions to least-specific, followed by all internal rewrite, again in order from most-specific patterns and conditions to least-specific. If you implement access control rules, these generally should precede all other rules, since there is no use wasting time or CPU resources on redirecting or rewriting unwelcome requests.
Jim
The current pattern will match only if *any* single character appears after "aboutus_articles" and before ".asp", as in "/aboutus_articlesX.asp" -- probably not what you intended.
Jim