关于apache伪静态URL配置RewriteEngine on出现403错误(转)

转载自 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:

<Directory "/www/webroot">
Order allow,deny
AllowOverride Options FileInfo
AllowOverride AuthConfig
Allow from all
</Directory>
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 ]
原文地址:https://www.cnblogs.com/lddhbu/p/2616925.html