如何在WAMP配置codeigniter mod_rewrite的? [英] how to configure codeigniter mod_rewrite on wamp?
问题描述
大家好请你告诉我,我怎么能在WAMP配置codeigniter mod_rewrite的?
Hi guys could you please tell me how can I configure codeigniter mod_rewrite on wamp?
我试着启用它通过WAMP菜单(WAMP - >阿帕奇 - > Apache模块 - >重写模块)并重新启动WAMP但它像什么也没发生。
I've tried enabling it through the wamp menu(wamp-->apache-->apache modules-->rewrite module) and restarting wamp but it's like nothing happened.
我要问你们这个事业我需要在我的codeigniter的URL通过的.htaccess摆脱index.php文件的
I'm asking you guys this cause I need to get rid of the index.php in my codeigniter urls through .htaccess
推荐答案
有你需要遵循(我考虑到你对安装在C WAMP共有4个简单的步骤:\\ WAMP
和codeIgniter一直提取到 C:\\ WAMP \\ WWW \\ codeigniter \\
)
There are total 4 easy steps that you need to follow (I am considering you have WAMP installed on C:\wamp
and CodeIgniter has been to extracted to C:\wamp\www\codeigniter\
):
- 创建一个.htaccess文件如 HTTP提到://$c$cigniter.com/wiki/
的RewriteBase /
与的RewriteBase / codeigniter /
根据你的路径mod_rewrite的但替换。 - 将在此文件
C:\\ WAMP \\ WWW \\ codeigniter \\
文件夹 - 打开httpd.conf文件,无论是从
WAMP-> Apache->的httpd.conf
或手动从C:\\ WAMP \\ BIN \\ Apache的\\的conf \\ httpd.conf文件
然后找到行#LoadModule rewrite_module模块/ mod_rewrite.so
,并从一开始就替换哈希(#)从而使整条生产线成为的LoadModule rewrite_module模块/ mod_rewrite.so
。现在重启Apache。 - 最后打开文件
C:\\ WAMP \\ WWW \\ codeigniter \\程序\\ CONFIG \\ config.php文件
和替换$配置[ index_page'] =的index.php;
本$配置['index_page'] =;
- Create a .htaccess file as mentioned in http://codeigniter.com/wiki/mod_rewrite but replace
RewriteBase /
withRewriteBase /codeigniter/
according to your path. - Place this file in
C:\wamp\www\codeigniter\
folder - Open the httpd.conf file either from
WAMP->Apache->httpd.conf
or manually fromC:\wamp\bin\Apache\conf\httpd.conf
then locate the line#LoadModule rewrite_module modules/mod_rewrite.so
and replace the hash(#) from the beginning so that the complete line becomesLoadModule rewrite_module modules/mod_rewrite.so
. Now Restart Apache. - Finally open the file
C:\wamp\www\codeigniter\application\config\config.php
and replace$config['index_page'] = "index.php";
with this$config['index_page'] = "";
您的URL现在应该是干净的例子的http://本地主机/ codeigniter /博客
等
Your URLs should now be clean example http://localhost/codeigniter/blog
etc.
在情况下,它没有工作,请参考官方的wiki:的http:// codeigniter.com/wiki/mod_rewrite
In case it didn't work, refer to the official wiki: http://codeigniter.com/wiki/mod_rewrite
这篇关于如何在WAMP配置codeigniter mod_rewrite的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!