我有这样的urls:
http://domain.com/test/MzA5
http://domain.com/test/AtbC
http://domain.com/test/4gCA如何创建htaccess规则,将所有urls (如此处的http://domain.com/test/[hash )重定向到一个页面,例如http://domain.com/page.html
发布于 2012-02-27 03:56:48
尝试:
Redirect 301 /test/MzA5 /page.html如果你有很多这样的散列,你可以做很多301重定向:
Redirect 301 /test/MzA5 /page.html
Redirect 301 /test/AtbC /page.html
Redirect 301 /test/4gCA /page.html或者考虑使用RewriteMap (它需要访问服务器配置,在.htaccess文件中不起作用)
发布于 2012-02-27 04:20:26
要将/ page.html /*/形式的所有URL重定向到测试,请使用以下重写:
RewriteEngine On
RewriteRule ^/test/[^/]+/? /page.html [R=301, L]https://stackoverflow.com/questions/9446092
复制相似问题