0

我需要将所有可能的请求重写到服务器的路径

示例:如果我输入https://wwww.myhost.com/#hi=random+text+1?stop=now

我需要重定向到:

http://myhost.com/

可以使用url.rewrite吗?

谢谢

4

1 回答 1

0

你真正想要达到什么目的?是否要隐藏 URL,以便它始终显示http://myhost.com。我相信如果你有超过一页,这是不可能的。

您是否尝试将所有内容重定向到例如 index.php

    重写引擎开启
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?anything=$1 [QSA,L]

这种方式例如http://myhost.com/example/将像请求一样处理http://myhost.com/index.php?anything=example

于 2013-10-23T20:32:27.400 回答