I need to redirect any requests to mysite.com/promotion/* pages to just mysite.com/*, so a few examples would be:
- mys开发者_运维百科ite.com/promotion/some/page.html would redirect to mysite.com/some/page.html
- mysite.com/promotion/another-page.html would redirect to mysite.com/another-page.html
How can this be done with .htaccess?
RewriteRule ^/promotion/(.*)$ /$1 [R=301]
Did it like this:
Redirect permanent /promotion/ http://www.mysite.com/
I didn't realize that it would automatically work recursively like that, but it seems to work fine.
精彩评论