设为首页 收藏本站
查看: 805|回复: 0

[经验分享] 关于apache伪静态URL配置RewriteEngine on出现403错误(转)

[复制链接]

尚未签到

发表于 2015-8-2 10:37:45 | 显示全部楼层 |阅读模式
转载自 btb368
最终编辑 btb368  

from: http://hi.baidu.com/my_labs/blog/item/d0f3af4500aa2c85b2b7dcb1.html

关于apache伪静态URL配置RewriteEngine on后出现403错误,这个问题,找来找去,国内网站上没找到正确的解决方案,apache官方文档上也没找到正确的说法L,还是人家老外厉害:http://www.issociate.de/board/post/294029/RewriteEngine_causes_403_Forbidden_error.html ,解决方案:在apache配置文件httpd.conf中,修改两项配置: Options FollowSymLinks(这项配置的修改说明是国网站上你找不到的)、AllowOverride All。之后就是 在 .htaccess中写正则咯……


RewriteEngine causes 403 Forbidden error

When I try to use RewriteEngine in an .htaccess file--
RewriteEngine On
--the page produces a 403 error. I've even tried--
RewriteEngine On
RewriteBase /
--and--
RewriteEngine On
RewriteBase /
RewriteRule html html
but this gives me the same result. The specifics of the error are:
"You don't have permission to access ____ on this server."
Clearly, I'm just trying to get RewriteEngine to work at a basic
setting, before I get into any real funkiness.
(Some background:
The final destination for my site is on an apache server that I don't
administrate, which is why I use .htaccess.
I've duplicated these limitations in a development server on my
computer. In DEV, I've loaded the mod_rewrite.so module into my
server's httpd.config file. Then I stopped and restarted the server.
With or without this module, my site works fine. It's only once I turn
the RewriteEngine on that I begin to get errors.)
EverettLindsay [ So, 15 Januar 2006 05:50 ] [ ID #1142408 ]

Re: RewriteEngine causes 403 Forbidden error

I'd check your httpd.conf file, and check the options for your
AllowOverride. AuthConfig should be enabled in AllowOverride. You
should have line in the file that looks like the following:
AllowOverride AuthConfig
Give that a shot, and see if it works for you.
mikedawg [ So, 15 Januar 2006 08:59 ] [ ID #1142409 ]

Re: RewriteEngine causes 403 Forbidden error

When I do that, I get a 500 error, regardless of the RewriteEngine.
This is what my directory settings look like:

Order allow,deny
AllowOverride Options FileInfo
AllowOverride AuthConfig
Allow from all

EverettLindsay [ So, 15 Januar 2006 19:58 ] [ ID #1142412 ]

Re: RewriteEngine causes 403 Forbidden error

Are you getting any error messages in your Apache httpd error log file?
mikedawg [ Mo, 16 Januar 2006 15:54 ] [ ID #1143656 ]

Re: RewriteEngine causes 403 Forbidden error

Sorry about that, I needed to go back and reread your original post. .
.. I'm looking into this problem, I had the exact same thing going on
with my system, now I need to look back to find what I changed to fix
it.
mikedawg [ Mo, 16 Januar 2006 15:55 ] [ ID #1143657 ]

Re: RewriteEngine causes 403 Forbidden error

A thing to double check is to ensure that mod_rewrite is enabled. Can
you verify that mod_rewrite is enabled via a httpd -l ?
mikedawg [ Di, 17 Januar 2006 19:16 ] [ ID #1145379 ]

Re: RewriteEngine causes 403 Forbidden error

Ok, I found it. You need to ensure that under the "Options" directive,
you have FollowSymLinks set.
i.e.
Options +FollowSymLinks
mikedawg [ Di, 17 Januar 2006 19:23 ] [ ID #1145380 ]

Re: RewriteEngine causes 403 Forbidden error

Bingo. That did it.
Thanks, Mike.
--E.
EverettLindsay [ Do, 19 Januar 2006 13:48 ] [ ID #1148903 ]

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-93241-1-1.html 上篇帖子: apache的worker与prefork的优化 下篇帖子: Spring + Tomcat 启动报错java.lang.ClassNotFoundException: org.apache.commons.pool.im
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表