我正在尝试让 FuelPHP 在我的服务器上工作。我无权将 .htaccess 文件用于 RewriteRule。但是,我的主机允许我指定 httpd.conf 文件的一部分。
以下适用于我想要的:
<Directory /Applications/XAMPP/xamppfiles/htdocs/sandbox/username/public>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</Directory>
但是,我需要它不仅仅用于其中的“用户名”。如何在此目录中使用通配符,以便它适用于一次性解决方案的任何“用户名”值?
我在apache 手册上找到了这个建议,但我不确定如何让它与RewriteRule
.
尝试了以下但没有奏效:
<Directory /Applications/XAMPP/xamppfiles/htdocs/sandbox/*/public>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</Directory>
请帮忙!