我已经inheritance了一个服务器上有几个域名。 这个网站在过去的两年里被重新devise,我正在努力强迫员工请求redirect工作(如果可以的话)。
所以现在在服务器上,我有一个redirect,每301,并将其转储到网站的首页。
RedirectMatch /(.) http://www.example.com
对于来自包含旧喜欢结构的各种网站的大部分旧url来说,这一切都运行良好。
然而,现在一名工作人员想要一个被广泛使用的URL,将其redirect到适当的位置。
redirect/new/research/Exp_Rese_Disc/Asia/example.shtml http://example.com/asia/
这可能没有杀死所有包含301redirect?
有一个一般的RedirectMatch /(。)redirect以及一个单一的redirect?
到现在为止,似乎没有让我。 任何想法,想法或例子都非常感激。
您可能会考虑切换到RewriteConf / RewriteRule对,更容易控制逻辑stream。
例如:
RewriteEngine on RewriteCond %(REQUEST_URI) ^/new/research/example.shtml$ [NC] RewriteRule ^(.*)$ http://example.com/asia [R=301,L] RewriteCond %(REQUEST_URI) /(.) RewriteRule ^(.*)$ http://example.com [R=302] #Drop the www RewriteCond %(HTTP_HOST) !^example.com$ [NC] RewriteRule ^(.*)$ http://example.com$1 [R=301]
或者沿着这些线… Apache有几个 很好的 参考资料 。