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 errorWhen 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.) Re: RewriteEngine causes 403 Forbidden errorI'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. Re: RewriteEngine causes 403 Forbidden errorWhen 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> Re: RewriteEngine causes 403 Forbidden errorAre you getting any error messages in your Apache httpd error log file?
Re: RewriteEngine causes 403 Forbidden errorSorry 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. Re: RewriteEngine causes 403 Forbidden errorA thing to double check is to ensure that mod_rewrite is enabled. Can
you verify that mod_rewrite is enabled via a httpd -l ? Re: RewriteEngine causes 403 Forbidden errorOk, I found it. You need to ensure that under the "Options" directive,
you have FollowSymLinks set. i.e. Options +FollowSymLinks Re: RewriteEngine causes 403 Forbidden errorBingo. That did it.
Thanks, Mike. --E. |