I have a path in some of my urls that results in an undesirable destination that I dont want users to browse to: i.e: http://mywebsite/mysite/undesirable-path/anything-could-be-here/
When users browse to any page with /undesirable-path/ in the url Id like them to just end up at the home page.
another more complex exam开发者_JAVA技巧ple would be:
- http://mywebsite/mysite/undesirable-path/anything-could-be-here/
- http://mywebsite/yoursite/undesirable-path/anything-could-be-here/
so something like ?/undesirable-path/? - anything before and anything after.
http://www.htaccessredirect.net/index.php
//301 Redirect Entire Directory
RedirectMatch 301
www.mysite.com/baddir/(.*)
www.mysite.com/$1
精彩评论