htaccess 子域中的静态文件
我的主文件夹的 htaccess 中有以下内容
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^css/(.*)\.css$ - [L]
RewriteRule ^(.*)\.css$ - [L]
第二条规则工作正常。即直接访问主目录下的CSS文件。但是,这并没有传播到目录“css”。因此我创建了第一条规则。这也是行不通的。
规则不传播是否有特殊原因,或者我在这里遗漏了什么?
I have the following in the htaccess of my main folder
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^css/(.*)\.css$ - [L]
RewriteRule ^(.*)\.css$ - [L]
The second rule works fine. That is, the CSS files in the main directory are accessed directly. However, this was not propagating to the directory "css". Hence I created the first rule. That is also not working.
Is there a particular reason why the rules don't propagate or am I missing something here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在感觉自己好傻。事实证明重写规则都是正确的。错误与文件夹权限有关。一旦设置完毕,该网站就会按预期运行。
把这个留在这里,以防有人陷入和我一样的困境!
I feel so stupid right now. Turns out the Rewrite rules were all correct. The error was with the folder permissions. Once that was set, the site is functioning as expected.
Just leaving this here in case someone gets stuck at the same point as I did!