开发者

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

开发者 https://www.devze.com 2023-02-16 07:16 出处:网络
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/

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

精彩评论

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