这是我的结构:
- app
- assets
- css
- js
- views
index.html
- vendor
.htaccess
index.php
.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(assets|bower_components|dist)/(.*)$ /app/$1/$2 [L,NC]
RewriteCond %{REQUEST_URI} !^assets|bower_components|dist/.*$
RewriteRule ^ index.php [L,QSA]
我的问题是当我尝试加载时:
/assets/css/style.css
从 index.html
它给了我 404
。
为什么会这样?
最佳答案
在 .htaccess 文件中更改
RewriteBase /
到
RewriteBase /assets
关于php - Slim .htaccess 静态文件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35521054/