我使用的Apache重写我的网址为清洁的网址。
重写规则^(。*)的index.php目前这种重写的目录也一样,这是我想要的,因为我想通过我的路由器/ index.php文件运行一切。
我想不过的事,就是有,我可以直接访问一个文件夹。这是LIB文件等的.js和.css文件。我知道如何使用别名做到这一点,但我不能用在.htaccess文件,我需要使用。
我怎么能不重写一个特定的文件夹,例如。所谓的LIB?
编辑:
我没有找到一个在.htaccess如何捏造别名下面的例子,但我不能得到它的工作:
重写规则/旧文件夹/新文件夹[PT]解决方案
重写规则^ / lib目录/.+$ - [L] 重写规则^(。*)的index.phpI am using Apache to rewrite my URLs into clean URLs.
RewriteRule ^(.*) index.phpCurrently this rewrites directories too, which is what I want, since I want everything run through my router/index.php file.
What I would like to do however, is have one folder that I can access directly. This is for lib files such as .js and .css files. I know how to do this with an Alias, but I can't use that in a .htaccess file, which I need to use.
How can I not rewrite a specific folder, eg. called "lib"?
EDIT:
I did find the following example of how to fake an Alias in .htaccess, but I can't get it working:
RewriteRule /old-folder /new-folder [PT]解决方案 RewriteRule ^/?lib/.+$ - [L] RewriteRule ^(.*) index.php
更多推荐
阿帕奇重写URL,但不重写某些文件夹
发布评论