我不是Apache专家,但需要对Web服务器进行一些小改动。 我们正在引入与主要url不同的“跳转页面”url(为了跟踪原因)。
/productA/index.html /productA/jump_index.html
基本上我想logging jump_index.html被请求,然后返回index.html 。 我不希望客户等待8秒左右的redirect。
我们应该如何处理呢? 简单地符号链接(或别名)在文件系统中的文件? 使用mod_alias Alias Match (如果真的如此)? 更好的东西呢?
在httpd.conf中编辑: mod_rewrite :
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule .* - [F] </IfModule>
只需使用HTTPredirect,例如使用RedirectPermanent或使用RedirectMatchdynamic更多:
RedirectPermanent /productA/jump_index.html http://example.com/productA/index.html RedirectMatch permanent \/(product.*)\/jump_index\.html http://example.com/$1/index.html
你可以使用一个简单的redirect头
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=index.html">
例如