apache下安装mod_rewrite模块
在网上找了一些apache下安装mod_rewrite模块的文章,说得都很轻巧,但是俺一路碰壁,怎么都出不来。整理了一下,以后再来研究。
一. 编译rewrite模块
在apache 2.0.61下按照rewrite模块失败,目前还没有找到原因。
使用apache 2.2.6按照rewrite模块,采用的方式是在编译apache前,configure增加参数
./configure --prefix=/data/aoxj/artest/apache --enable-so --enable-rewrite=shared
然后再执行make;make install可以成功的编译出mod_rewrite.so
(在2.0.61下失败,只编译出mod_rewrite.a文件,原因不明)
尝试在2.0.61下用以下设置编译apache都没有成功。
./configure --prefix=/data/aoxj/artest/apache --enable-so --enable-rewrite --enable-shared=rewrite
./configure --prefix=/data/aoxj/artest/apache --enable-module=so --enable-module=rewrite --enable-shared=rewrite
这句是网络硬盘系列编译apache时使用的,在apache1.*上可以打包出mod_rewrite.so。
但是在apache2.0.61上失败。
(估计是参数写法各个版本不同,以后有时间再来研究)。
二. 配置apache
在apache的配置文件apache/conf/httpd.conf中增加以下内容:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine On
RewriteLog logs/rewrite.log
RewriteLogLevel 3
#RewriteRule ^/~jid=[^/]*/(.*) /$1 [PT,L]
RewriteRule中测试过上面的^/~jid=[^/]*/(.*) /$1 [PT,L],apache会将
http://10.3.2.35:11280/~jid=abcMLHHOULJHLKJ/wmail/welcome.action
这样的请求,改写为
http://10.3.2.35:11280/wmail/welcome.action
分享到:
相关推荐
本文实例讲述了php检测apache mod_rewrite模块是否安装的方法。分享给大家供大家参考。具体实现方法如下: /** * @title Check if Apache's mod_rewrite is installed. * * @author Pierre-Henry Soria * @...
如果你的服务器apache还没有安装,那很简单,在编译apache时将mod_rewrite模块编译进去就可以,相关文档可以在http://man.chinaunix.net/newsoft …… ew/mod/mod_rewrite. html中找到。如果你的apache已经安装好了...
主要介绍了如何开启Apache mod_rewrite模块,需要的朋友可以参考下
前提Apache中的mod_rewrite模块为激活状态,既然要消灭掉mp3文件的盗链就顺便也把图片盗链的设置给做了,下面是我在网站根目录的.htaccess文件中的配置,供同病相怜之人参考:。 view plaincopy to clipboard...
apache rewrite_module模块使用教程
APACHE的 MOD_rewrite模块. 大家可以看一个演示的一个 PHP学习论坛 [url]http://www.phpx.com/happy/… 这个论坛的版面和帖子,就是运用了这个技术,地址静态化.但是是假的. 这个技术哪里好? 可以让baidu, google...
另外,也可以通过将 /etc/apache2/mods-available/rewrite.load 连接到 /etc/apache2/mods-enabled/rewrite.load 来打开 Mod_rewrite 模块。用指令操作就是: sudo ln -s /etc/apache2/mods-available/rewrite.load ...
它兼容Apache的mod_rewrite的语法,从而使仅仅复制.htaccess文件就把配置从appach移植到IIS中或者从IIS移值到appach中变成可能。请参阅3.2兼容性图表这一节。 ISAPI_Rewrite最重要的功能: ISAPI_Rewrite提供了和...
首先确定您使用的 Apache 版本,及是否加载了 mod_rewrite 模块。 Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码: LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c ...
有关我的bugtraq发布和CVE-...2006年7月28日,Mark Dowd(McAfee Avert Labs)向bugtraq邮件列表报告了在mod_rewrite apache模块中发现的漏洞。 易受攻击的函数是escape_absolute_uri(),仅当mod_rewrite处理LDAP URL
ZendFramework的控制器可以被设置支持使用clean urls,这点在apache下很好写,前提是apache支持mod_rewrite模块,然后通过设置.htaccess可以对ZendFramework单独控制.但是在IIS写如何设置呢? 问题很简单,通过...
# 安装说明 * 1、程序的框架是Laravel 5.8,因此需要环境... * 确保 Apache 启用了 mod_rewrite 模块以支持 .htaccess 解析。 * Nginx 伪静态配置 location / { try_files $uri $uri/ /index.php?$query_string; }
在Windows Vista和Windows Server 2008上安装ISAPI_Rewrite,还必须先安装下面两个模块(默认情况下这两个模块是不安装的) ? ISAPI过滤器 ? ISAPI 扩展 2.2安装程序 在运行安装包之前请先阅读系统要求部分。下载并...