0

是否可以在 apache 中路由任何 URL 以始终指向我的 VirtualHost 中的 DocumentRoot?

所以 f.ex:/foo/bar/将始终请求/.

我在想类似的东西(请原谅我的新手伪代码):

AliasMatch ^/.* DocumentRoot
4

1 回答 1

0

像下面这样的东西似乎是大多数 CMS 使用的模式。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
于 2012-05-21T20:33:35.157 回答