【发布时间】:2014-02-21 13:50:31
【问题描述】:
使用 WAMP 进行一些本地 PHP 开发。将所有请求路由到 index.php,except 请求位于文档根目录之外的父目录中的样式表和图像等资产。目录布局如下:
C:\WAMP\www\
↳ mySite
↳ public
↳ .htaccess
↳ index.php
↳ assets
↳ style
↳ desktop.css
.htaccess
RewriteEngine on
RewriteBase /mySite/
RewriteCond %{REQUEST_URI} \.css$ [NC]
RewriteRule ^(.*)$ assets/$1 [L]
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^(.+)\/?$ index.php?url=$1 [L,QSA]
mySite.conf
Alias /mySite/ "C:/WAMP/www/mySite/public/"
<Directory "C:/WAMP/www/mySite/public/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
结果
localhost/mySite/ - 按预期返回 index.php
localhost/mySite/style/desktop.css 返回内部服务器错误
我错过了什么?
谢谢
【问题讨论】:
标签: php css apache .htaccess mod-rewrite