URL change, SOS rewriterule Regular expression
Because before the Web site feel inadequate specification, so re-adjust the URL, but did not think, Baidu submitted delete URL for a long time, now included or the previous URL, in order not to affect customer access, now want to put the old URL batch redirect to the new URL,
The old format is as follows: http://www.songhuala.com/p1099/Beijing gift/china_flowers_info.html
The new format is as follows: http://www.songhuala.com/-p-1099.html
I did the following redirects in. htaccess,
Rewriteengine on
Rewritecond%{request_uri} ^p/d+\/.*\/china_flowers_info\.html$
Rewriterule ^ (. *) $ ^-p-/d+\.html$1 [r=301,l]
But how can not be directed to the correct new URL, I hope friends can help pointing, I test an afternoon, or did not change the regular expression. Please crossing to enlighten you. Appreciate. . htaccess Regular Expressions Rewriterule Bulk URL Redirection seo?url? Rewrite
------Solution--------------------
Rewritecond%{request_uri} ^p/ d+\/.*\/china_flowers_info\.html$
Rewriterule ^ (. *) $ ^-p-/ d+\.html$1 [R=301,l]
The red part seems to be wrong
------Solution--------------------
Rewriteengine on
Rewritebase/
Rewritecond%{request_uri} p (\d+)
Rewriterule p (\d+) http://www.songhuala.com/-p-$1.html [r=permanent,l]