更新时间:2023-02-24 10:59:32
您有两个基本选择:
捕获所有传入的请求(除了图片,样式表等)到服务器端的前端控制器(PHP,ASP,或者你使用任何服务器端语言),并用做重定向有头(....)
。这是最简单和最流行的方式。
Catch all incoming requests (except for images, style sheets, etc.) into a server-side front controller (PHP, ASP or whatever server-side language you use), and do the redirection there using header(....)
. This is the easiest and most popular way.
使用Apache的 RewriteMap指令
指令经常写你映射到文本文件,mod_rewrite的可以看看。
Use Apache's RewriteMap
directive to frequently write your maps into text files that mod_rewrite can look up.
在 RewriteMap指令
的变通办法是有益的特殊omptimization情景的许多的流量。通常情况下,机会是你富裕的第一个选项。
The RewriteMap
alternative might be beneficial in special omptimization scenarios with lots of traffic. Usually, chances are you're well off with the first option.