2019独角兽企业重金招聘Python工程师标准>>>

apache2.2.21下为codeigniter配置url地址重写

1、首先打开apache的配置文件,httpd.conf,找到#LoadModule rewrite_module modules/mod_rewrite.so,去掉前面的#号,开启mod_rewrite模块

2、找到

<Directory />

Options FollowSymLinks AllowOverride none Order deny,allow Deny from all </Directory>

修改为:
<Directory />Options FollowSymLinksAllowOverride AllOrder deny,allowDeny from all
</Directory>
3、找到
<Directory "D:/Program Files (x86)/Web/www">
# Possible values for the Options directive are "None", "All",
# or any combination of:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that "MultiViews" must be named *explicitly* --- "Options All"# doesn't give it to you.## The Options directive is both complicated and important.  Please see# http://httpd.apache.org/docs/2.2/mod/core.html#options# for more information.#Options Indexes FollowSymLinks## AllowOverride controls what directives may be placed in .htaccess files.# It can be "All", "None", or any combination of the keywords:#   Options FileInfo AuthConfig Limit#AllowOverride none## Controls who can get stuff from this server.#Order allow,denyAllow from all</Directory>
修改为:
<Directory "D:/Program Files (x86)/Web/www">## Possible values for the Options directive are "None", "All",# or any combination of:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that "MultiViews" must be named *explicitly* --- "Options All"# doesn't give it to you.## The Options directive is both complicated and important.  Please see# http://httpd.apache.org/docs/2.2/mod/core.html#options# for more information.#Options Indexes FollowSymLinks## AllowOverride controls what directives may be placed in .htaccess files.# It can be "All", "None", or any combination of the keywords:#   Options FileInfo AuthConfig Limit#AllowOverride All## Controls who can get stuff from this server.#Order allow,denyAllow from all</Directory>
以上主要是修改 AllowOverride one为 AllowOverride All
4、打开你的ci目录的application/config下的config.php,查找$config['index_page']变量,将它的值留空
5、为ci编写.htaccess文件,站长的CI安装在网站根目录的friend目录下,应此.htaccess的内容如下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /friend/index.php/$1 [QSA,PT,L]
</IfModule>
如果你的ci就是安装在网站根目录,那么,你的.htaccess内容应该为:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [QSA,PT,L]
</IfModule>
嗯,相信大家都看出区别了,就是多了一个ci的安装目录,但是却很重要。
6、重启apache,搞定。

转载于:https://my.oschina.net/bootstrap/blog/85442

apache2.2.21下为codeigniter配置url地址重写相关推荐

  1. linux添加ip白名单_centOS7 下利用iptables配置IP地址白名单的方法

    编辑iptables配置文件,将文件内容更改为如下,则具备了ip地址白名单功能 #vim /etc/sysconfig/iptables *filter :INPUT ACCEPT [0:0] :FO ...

  2. php重写地址,php url地址重写

    地址重写: urlRewrite: 就是:  1. 将php的地址index.php不写只写Action模块和function方法, 或者 2. php地址转变成html地址, 就是一种假的html, ...

  3. Urlrewrite(url地址重写)和UrlRewriteFilter

    Urlrewrite(url地址重写)和UrlRewriteFilter Urlrewrite: urlRewrite就是我们通常说的地址重写,用户得到的全部都是经过处理后的URL地址 UrlRewr ...

  4. Apache的URL地址重写 RewriteCond与RewriteRule

    Apache的URL地址重写 http://hi.baidu.com/sonan/blog/item/c408963d89468208bba16716.html 第一种方法:Apache环境中如果要将 ...

  5. Apache的URL地址重写(RewriteCond与RewriteRule)

    Apache的URL地址重写 http://hi.baidu.com/sonan/blog/item/c408963d89468208bba16716.html 第一种方法:Apache环境中如果要将 ...

  6. cookie与session详解、url地址重写

    cookie与session详解.url地址重写:https://www.cnblogs.com/l199616j/p/11195667.html

  7. JAVA WEB项目隐藏url真实路径,url地址重写UrlRewriteFilter

    有这么一种情况,不想让别人知道你项目访问的真实url,或者为了让url方便记忆,想用自己想用的url,该怎么办呢? 1.隐藏url的真实路径 2.url的重写 UrlRewriteFilter可以完美 ...

  8. [2007最后一博]Url地址重写,利用HttpHander手工编译页面并按需生成静态HTML文件...

    很多朋友可能都讨论过ASP.NET中生成HTML的方法了,有按照模板用IO方法写文件 有在404错误页面内生成HTML的,有在Render内保存页面输出到HTML文件的. 今天我发一个配合Url重写利 ...

  9. php url地址 怎么写,php url地址重写

    地址重写: urlRewrite: 就是:  1. 将php的地址index.php不写只写Action模块和function方法, 或者 2. php地址转变成html地址, 就是一种假的html, ...

最新文章

  1. 暴力裁员?小米回应来了,网友表示没毛病!
  2. springboot 修改了端口不生效_Spring Boot 项目 Docker 化快速上手
  3. Mac OS使用技巧十九:Safari碉堡功能之二查看网页源代码
  4. 技术方案包括哪些内容_揭秘:网络营销推广方案的内容包括哪些?
  5. Java 面向抽象编程和面向接口编程
  6. Cause: org.postgresql.util.PSQLException: ERROR: column province_id does not exist
  7. Firefox 10正式发布
  8. no number java_java.lang.NumberFormatException问题!!!
  9. 软件测试需注意的事项
  10. win764bit下Eclipse连接ubuntu中hadoop2.6经验总结
  11. Harmony OS — RadioButton RadioContainer单选按钮单选按钮组
  12. mysql varbinary 插入_Mysql中如何插入VarBinary二进制类型?
  13. Virtualbox安装虚拟机教程
  14. 为什么c语言没落了,编程语言Go飞速大涨,Delphi走向没落
  15. 双硬盘双系统安装win10和centos7
  16. 使用 Onedrive 来同步Mac 桌面
  17. 企业微信付款到零钱,全代码讲解,包含怎么加入商户证书
  18. cesium获取模型实时坐标_cesium获取坐标及高程
  19. 二次函数图像如何用计算机绘制,如何快速画二次函数图像
  20. <keep-alive></keep-alive>的作用是什么?

热门文章

  1. 共享GPU来了!投身去中心化机器学习,比挖矿多赚3倍
  2. logstash关于date时间处理的几种方式总结
  3. busybox(二)编译
  4. 201621123053《Java程序设计》第十一周学习笔记文章
  5. android开关控件Switch和ToggleButton
  6. 华为2017.7.26机试
  7. MySQL的basedir
  8. STL总结之deque
  9. Reporting service 技巧
  10. asp.net控件开发基础系列