【发布时间】:2012-05-31 18:55:27
【问题描述】:
感谢阅读。首先,我在根目录中有一个 .htaccess,其中包含以下语句:
# Mod Rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ /root/ [L]
RewriteRule (.*) /root/$1 [L]
</IfModule>
在根文件夹中我得到了这个文件:
# Mod Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /root/index.php/$1 [PT,L]
</IfModule>
另外,在文件夹 /root 中,我有三个文件夹:css、js 和 images。
我的应用程序被设计为与我的 MVC 框架分离(有点像 CodeGgniter)。所以这是树:
- application
- my application files are there
- root
- css
- js
- images
- grecko
- my mvc framework files are there
这样,我可以更新我的框架,而无需触及在应用程序文件夹下运行的整个网站。
不管怎样,我现在想做的就是把我上面说的三个文件夹(css、js和images)移动到/application/assets/里面。但由于所有内容都被重定向到/root/,我需要一个规则,允许将http://www.domain.tld/css/blabla.css 之类的请求映射到/application/assets/css/blabla.css 等。
我尝试过,但没有成功。
谢谢。
【问题讨论】:
标签: php model-view-controller .htaccess apache2