如何在WAMP配置codeigniter mod_rewrite的? [英] how to configure codeigniter mod_rewrite on wamp?

查看:120
本文介绍了如何在WAMP配置codeigniter mod_rewrite的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好请你告诉我,我怎么能在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\):


  1. 创建一个.htaccess文件如 HTTP提到://$c$cigniter.com/wiki/ 的RewriteBase / 的RewriteBase / codeigniter / 根据你的路径mod_rewrite的但替换。

  2. 将在此文件 C:\\ WAMP \\ WWW \\ codeigniter \\ 文件夹

  3. 打开httpd.conf文件,无论是从 WAMP-&G​​T; Apache->的httpd.conf 或手动从 C:\\ WAMP \\ BIN \\ Apache的\\的conf \\ httpd.conf文件然后找到行 #LoadModule rewrite_module模块/ mod_rewrite.so ,并从一开始就替换哈希(#)从而使整条生产线成为的LoadModule rewrite_module模块/ mod_rewrite.so 。现在重启Apache。

  4. 最后打开文件 C:\\ WAMP \\ WWW \\ codeigniter \\程序\\ CONFIG \\ config.php文件和替换 $配置[ index_page'] =的index.php; $配置['index_page'] =;

  1. Create a .htaccess file as mentioned in http://codeigniter.com/wiki/mod_rewrite but replace RewriteBase / with RewriteBase /codeigniter/ according to your path.
  2. Place this file in C:\wamp\www\codeigniter\ folder
  3. Open the httpd.conf file either from WAMP->Apache->httpd.conf or manually from C:\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 becomes LoadModule rewrite_module modules/mod_rewrite.so. Now Restart Apache.
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆