1

我不想手动设置每个站点RewriteBase.htaccess如何将其设置为相对,因此将站点根目录移动到新位置不需要对其进行任何修改。

我已经阅读了这个 http://michael.orlitzky.com/articles/avoiding_rewritebase_with_mod_rewrite.php但它似乎不适用于 .htaccess 文件。这是一个例子htaccess

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /test
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
4

1 回答 1

1

One way to avoid modifying RewriteBase in different setups is to use symlinks to create same name linked directory every where. And make sure you have this option set at the top:

Options +FollowSymLinks
于 2013-04-25T14:39:35.657 回答