【发布时间】:2014-12-19 09:24:10
【问题描述】:
我有一个问题,让我解释一下。
在 WAMP 上启用了 Rewrite_module
我的主机被映射:
127.0.0.1 localhost
127.0.0.1 mydomain.com
我的虚拟主机在 WAMP 上声明:
<VirtualHost *: 80>
ServerAdmin contact@mydomain.com
DocumentRoot "E:/wamp/www/subfolder/"
ServerName mydomain.com
ErrorLog "logs/mydomain.com.log"
CustomLog "logs/mydomain.com.log" common
<Directory "E:/wamp/www/subfolder /">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow, deny
Allow from all
</ Directory>
</ VirtualHost>
现在,没问题,mydomain.com 到达 E:/wamp/www/subfolder/
我的项目位于子文件夹中,例如 E:/wamp/www/subfolder/my-project/
我有一个 htaccess:
<Mod_rewrite.c IfModule>
RewriteEngine On
RewriteBase /my-project/
RewriteRule ^index\php$ - [L]
RewriteRule ^assets/css/(.*) /my-project/content/themes/assets/css/ $ 1 [QSA, L] [QSA, L]
RewriteCond% {REQUEST_FILENAME}! F
RewriteCond% {REQUEST_FILENAME}! -d
RewriteRule. /my-project/index.php [L]
</ IfModule>
我的问题来了。如果我继续访问 mydomain.com/my-project/ 它没有问题,但没有加载 css(例如),因为链接是:
mydomain.com/content/themes/assets/css/ 它应该有:
mydomain.com/my-project/content/themes/assets/css/
我认为 RewriteBase 不工作,我不知道为什么。
非常感谢你,对不起我的英语。
【问题讨论】:
标签: mod-rewrite rewrite wamp