htaccess:只允许通过完整的path访问文件,而不是重写的文件
在我的设置中,我有我的CMS驻留在一个子文件夹/子,我重写所有的访问根到这个子文件夹: ## Rewrite www.example.com to the CMS home page: www.example.com/corporate/index.php RewriteRule ^$ sub/index.php [L] ## Let the CMS process paths like www.example.com/corporate/about RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^sub/(.*)$ sub/index.php?q=$1 [L,QSA] ## Search for real CMS files that moved, ## (eg www.example.com/flash/intro.swf to www.example.com/corporate/flash/intro.swf) RewriteCond %{DOCUMENT_ROOT}/sub/$1 -f RewriteRule ^(.*)$ sub/$1 [L] ## Let CMS process all paths […]