为什么我的服务提供商限制我的 htaccess 使用?

Why is my service provider limiting my htacess use?

并在这个过程中让我的生活变得更加困难?

Bluehost 不让我用

# no access to this it seems
#DocumentRoot /public_html

# access to this however
#DirectoryIndex

他们的文档说我需要使用

# change the document root using rewrite rules per bluehost document
#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^(www.)?foo.com$
#RewriteCond %{REQUEST_URI} !^/web/
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ /web/
#RewriteCond %{HTTP_HOST} ^(www.)?foo.com$
#RewriteRule ^(/)?$ web/index.php [L] 

我以前遇到过这个问题,但看起来他们已经更新了访问权限,因此您可以使用 DirecotryIndex

查看 Bluehost 文档 here.

对于 DocumentRoot 他们有一个解决方案 here

您的 Web 框架列出了另一个解决方案 here

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    #RewriteBase /path/to/app
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
</IfModule>