我目前正在开发一个小型的框架,它采用的是htaccess的文档,它把所有流量从公共文件夹到另一个文件夹。但香港专业教育学院认识到,它也重定向所有直接链接到图片,CSS和脚本。
I am currently developing a mini framework which uses a htaccess doc which redirects all traffic from the public folder to another folder. But Ive realized that it also redirects all direct links to images, css and scripts.
我不那么熟悉的htaccess code,我怎样才能把这些异常在这个htaccess的code
I am not that familiar with htaccess code, how can I put those exceptions in this htaccess code
RewriteEngine on
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?cmd=$1 [PT,L]
在此先感谢
您无法路由的一切公共/
和的index.php
在同一时间。你可能想在这个规则你的的DocumentRoot /的.htaccess
:
You cannot route everything to public/
and index.php
at the same time. You probably want this rule in your DocumentRoot/.htaccess
:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]