这是我目前的htaccess:
DirectoryIndex main.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ main.php/$1 [QSA,L]
SetEnvIf MFW_ENV ^$ MFW_ENV=local
php_flag short_open_tag On
php_value memory_limit "2G"
php_value upload_max_filesize "2G"
php_value post_max_size "2G"
我的 htaccess :
/project/web/
我的
上有文件/project/local
我希望在访问时可以访问
/project/web/local
当我访问时,我正在这样做
website.com/local/file.zip
我可以访问:
/project/local/file.zip
代替。这是我网站目录的一个级别。
答案 0 :(得分:0)
您可以在/project/web/.htaccess:
SetEnvIf MFW_ENV ^$ MFW_ENV=local
php_flag short_open_tag On
php_value memory_limit "2G"
php_value upload_max_filesize "2G"
php_value post_max_size "2G"
DirectoryIndex main.php
RewriteEngine On
RewriteBase /project/web/
RewriteCond %{DOCUMENT_ROOT}/project/$1 -f
RewriteRule ^(local/.*)$ /project/$1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ main.php/$1 [L]