开发者

htaccess wildcard problem

开发者 https://www.devze.com 2023-03-25 21:40 出处:网络
I have recently migrated my site from Expression Engine to WordPress and I\'m getting a lot of 404\'s from the old EE paginated pages. I know I can\'t catch them all but if I could just get the catego

I have recently migrated my site from Expression Engine to WordPress and I'm getting a lot of 404's from the old EE paginated pages. I know I can't catch them all but if I could just get the categories to redirect to the main category pages by stripping the pagination code that would be a start here is the old offending URL structure:

/category/crazy-guitar-designs/P108

which I would like to permanently redirect to just

/category/crazy-guitar-d开发者_开发技巧esigns/

Is this possible with wildcards?


Try the RedirectMatch directive of mod_alias:

RedirectMatch 301 ^/category/crazy-guitar-designs/P[0-9]+ http://www.example.com/category/crazy-guitar-designs/

.+ is a Regular Expression for "one or more chars".

0

精彩评论

暂无评论...
验证码 换一张
取 消