apache rewrite
来源:互联网 发布:陌生人电话聊天软件 编辑:程序博客网 时间:2024/05/17 03:02
一、
通过phpinfo()函数查看环境配置,查看apache2handler中“Loaded Modules”已经开启的模块,如果里面包括“mod_rewrite”,则已经支持,不再需要继续设置。
如果没有,需要在httpd.conf 文件中进行设置,找到“LoadModulerewrite_module”,将前面的"#"号删除即可。
如果没有找到,那么在“LoadModule”区域最后加入“LoadModule rewrite_modulemodules/mod_rewrite.so”然后重启apache服务器即可。
二、让apache服务器支持".htaccess"
打开httpd.conf文件,查找定义网站主目录的Directory项,
将
Options FollowSymLinks
AllowOverride None
改为
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
这样rewrite和.htaccess的支持就设置好了。
三、测试
现在可以建立一个.htaccess文件来测试一下前面的设置。
在网站的根目录下建立.htaccess文件,
/.htaccess
RewriteEngine on
RewriteRule !/.(js|ico|gif|jpg|png|css)$ index.php
现在可以试试访问网站来确定rewrite有没有起作用。
通过phpinfo()函数查看环境配置,查看apache2handler中“Loaded Modules”已经开启的模块,如果里面包括“mod_rewrite”,则已经支持,不再需要继续设置。
如果没有,需要在httpd.conf 文件中进行设置,找到“LoadModulerewrite_module”,将前面的"#"号删除即可。
如果没有找到,那么在“LoadModule”区域最后加入“LoadModule rewrite_modulemodules/mod_rewrite.so”然后重启apache服务器即可。
二、让apache服务器支持".htaccess"
打开httpd.conf文件,查找定义网站主目录的Directory项,
将
Options FollowSymLinks
AllowOverride None
改为
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
这样rewrite和.htaccess的支持就设置好了。
三、测试
现在可以建立一个.htaccess文件来测试一下前面的设置。
在网站的根目录下建立.htaccess文件,
/.htaccess
RewriteEngine on
RewriteRule !/.(js|ico|gif|jpg|png|css)$ index.php
现在可以试试访问网站来确定rewrite有没有起作用。
- apache rewrite
- apache rewrite
- Apache Rewrite
- apache rewrite
- Apache rewrite
- apache rewrite
- Apache rewrite
- Apache--Rewrite
- apache rewrite
- apache rewrite
- Apache 配置 rewrite
- apache Rewrite 二级域名设定
- apache Rewrite 二级域名设定
- Apache rewrite 资料
- Apache rewrite规则写法
- Apache rewrite例子集合
- Apache URL rewrite规则
- Apache 的简单Rewrite
- Inclusive Makefile
- 原创 ···DELPHI 图片图形图像处理 PS置换滤镜效果,亮度/对比度,纹理贴图效果
- 动态链接库 Tips
- 编译Tips
- SMP MPP NUMA
- apache rewrite
- subpixel反走样
- linux引导程序剖析(一)
- linux引导程序剖析(二)
- C#笔记(1)--->基本语法 [运算符]
- 【转载】基于Flash的文件系统
- linux内核升级Tips
- 资料收集
- Word保存出错,解决“卡巴斯基 2009”与“Office 2003/2007”冲突的设置方法。