【发布时间】:2014-03-17 23:01:24
【问题描述】:
我的 Codeigniter .htaccess 文件有问题...基本上是这样的。
常规 .htaccess 文件(适用于我的本地主机):
RewriteEngine On
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
我放置所有文件的网站文件夹结构:
website.com/
css/
js/
img/
index.html
dev/
application/
assets/
system/
index.php
.htaccess <<< A problem now exists with this file
当我转到website.com/dev/ 而不是 index.php 文件时,网站现在正在尝试加载index.html 文件。
我尝试了 .htaccess 文件的不同变体,但我得到了 500 服务器错误或 index.html 文件。
如何将website.com/dev/ 路由到正确的index.php 文件?
提前致谢! 文森特·威尔基
更新
我有一个部分工作的 .htaccess 文件:
RewriteEngine On
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ http://website.com/dev/index.php/$1 [L]
这只是部分工作,因为 URL 现在显示 .../dev/index.php/controller/method/args
我知道使用mod_rewrite 的全部意义在于从URL 中删除index.php ... :(
【问题讨论】:
标签: php apache .htaccess codeigniter codeigniter-2