删除index.php
在论坛中看了好多如何删除index.php的方法,如http://codeigniter.org.cn/forums/thread-4-1-2.html,以及如何更改apache配置以支持rewrite模块,如http://dancewithnet.com/2010/05/29/making-mod-rewrite-and-htaccess-work-on-mac-os-x/,在我的机器上怎么就是不行啊,郁闷了,怎么配置到最后,运行时总是提示Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
但apache的htdocs下的其他php文件运行正常,我用的是apache2.2版本,有谁成功了,详细介绍下如何配置,从apache到CI,再此先谢谢了,大侠们!!!
你的问题解决方法是,首先你要把你的config.php文件中
$config['base_url'] = 'http://你的网址/';
然后
$config['index_page'] = 'index.php'; 换成 $config['index_page'] = '';
接着在根目录下.htaccess,中写
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
</IfModule>
然后就OK了 谢了,这样做后,好像加不加index.php都可以访问,是么? Ben 发表于 2011-9-26 16:35 static/image/common/back.gif
你的问题解决方法是,首先你要把你的config.php文件中
我按照你的,没成功,加上<IfModule mod_rewrite.c>就报错
http://www.crazyfriday.net/2013/02/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4url%E4%B8%ADindex-php%E7%9A%84%E7%BB%88%E6%9E%81%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ 如何删除URL中index.php的终极解决方案 Ben 发表于 2011-9-26 16:35 static/image/common/back.gif
你的问题解决方法是,首先你要把你的config.php文件中
我按照这个做,成功了。。。 热水只需一建:
借鉴:
PHP复制代码
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
</IfModule>
复制代码
一个完全被问烂了的问题:L
页:
[1]