1.启用mod_rewrite模块
在conf目录的httpd.conf文件中找到
LoadModule rewrite_module modules/mod_rewrite.so
将这一行前面的#去掉。
2.在要支持url rewirte的目录启用 Options FollowSymLinks和AllowOverride All
Alias /php "c:/web/php/"(这行不用加到http.conf里面)
<Directory "c:/web/php/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
这样通过http://localhost:8080/php/访问时,/php/和其下面的子目录将支持url rewrite。
后记:
网上的很多文章并没有提到要使用 Options FollowSymLinks,因为在httpd.conf中有
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
这样如果你的网站配置成通过http://localhost:8080/来访问,就不会注意到Options FollowSymLinks的影响,只需要将AllowOverride None改为AllowOverride All即可。而我习惯于在本机配置成http://localhost:8080/php/,忘了加Options Indexes FollowSymLinks就成功不了,会显示
Forbidden
You don't have permission to access /php/f2blog/ on this server.
这样的错误。后来还是在apache文档中找到了原因
Note: To enable the rewriting engine for per-directory configuration files you need to set ``RewriteEngine On'' in these files and ``Options FollowSymLinks'' must be enabled. If your administrator has disabled override of FollowSymLinks for a user's directory, then you cannot use the rewriting engine. This restriction is needed for security reasons.
实际上mod_rewrite是针对目录的,因此并不需要将httpd.conf中的所有AllowOverride None改为AllowOverride All,Options也一样。
BTW:看来首先是要看程序提供的文档,但是tomcat5.0.28的文档我几乎都看了,也没有看到说到底能不能通过service.bat在windows上安装成功服务。倒是看到N多人和我一样的疑问却没有答案,嗯,我当然知道通过tomcatxx.exe能安装成功tomcat服务,看来只有这一条路了。
分享到:
相关推荐
主要介绍了如何开启Apache mod_rewrite模块,需要的朋友可以参考下
本文实例讲述了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 rewrite_module模块使用教程
前提Apache中的mod_rewrite模块为激活状态,既然要消灭掉mp3文件的盗链就顺便也把图片盗链的设置给做了,下面是我在网站根目录的.htaccess文件中的配置,供同病相怜之人参考:。 view plaincopy to clipboard...
有关我的bugtraq发布和CVE-...2006年7月28日,Mark Dowd(McAfee Avert Labs)向bugtraq邮件列表报告了在mod_rewrite apache模块中发现的漏洞。 易受攻击的函数是escape_absolute_uri(),仅当mod_rewrite处理LDAP URL
另外,也可以通过将 /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模块. 大家可以看一个演示的一个 PHP学习论坛 [url]http://www.phpx.com/happy/… 这个论坛的版面和帖子,就是运用了这个技术,地址静态化.但是是假的. 这个技术哪里好? 可以让baidu, google...
首先确定您使用的 Apache 版本,及是否加载了 mod_rewrite 模块。 Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码: LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c ...
mod_rewrite mod_setenvif mod_so mod_speling mod_ssl mod_status mod_suexec mod_unique_id mod_userdir mod_usertrack mod_version mod_vhost_alias mpmt_os2(MPM) Apache MPM 公共指令 mpm_netware(MPM) winnt...
ZendFramework的控制器可以被设置支持使用clean urls,这点在apache下很好写,前提是apache支持mod_rewrite模块,然后通过设置.htaccess可以对ZendFramework单独控制.但是在IIS写如何设置呢? 问题很简单,通过...