开发者

redirect URL with specific words in the url path to another page

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:

  1. http://mywebsite/mysite/undesirable-path/anything-could-be-here/
  2. 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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜