views:

13

answers:

2

I need to redirect any requests to mysite.com/promotion/* pages to just mysite.com/*, so a few examples would be:

  • mysite.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?

A: 
RewriteRule ^/promotion/(.*)$ /$1 [R=301]
alex
Won't that just remove promotion from the URL but still serve up the same content? I want to literally redirect users from /promotion/whatever to /whatever.
Mike Crittenden
A: 

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.

Mike Crittenden