我想执行RedirectMatch
规则并排除网址:
RedirectMatch 301 /citycards/citycards-locations/muenchen/((?!trachtenvogl).*) city-news.info/citycards/citycards-locations/muenchen$1
我想要排除这个网址:
http://www.city-news.info/citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen
来自redirectMatch
你能看到错误吗?我怎样才能排除第二个网址?我希望有人可以帮助我
答案 0 :(得分:0)
在Root / .htaccess文件中尝试此操作
RedirectMatch ^/((?!citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen).+)$ http://city-news.info/citycards/citycards-locations/muenchen/$1
这将重定向
http://city-news.info/foo/bar
到
http://city-news.info/citycards/citycards-locations/muenchen/foo/bar
这不会重定向:
http://city-news.info/citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen