开发者

Apache rewrite URL but don't rewrite certain folder

开发者 https://www.devze.com 2022-12-20 08:23 出处:网络
I am using A开发者_StackOverflow中文版pache to rewrite my URLs into clean URLs. RewriteRule ^(.*) index.php

I am using A开发者_StackOverflow中文版pache to rewrite my URLs into clean URLs.

RewriteRule ^(.*) index.php

Currently 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
0

精彩评论

暂无评论...
验证码 换一张
取 消