htaccess wildcard problem
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".
精彩评论