Apache .htaccess after setting RewriteEngine On,website appears 403 Forbidden

  用 Joomla 4 Build a new website,After enabling SEO and URL Rewrite,Problem with website,At first Google to its own article - "Joomla URL rewrite 404 Can not be displayed」,Mainly because the AllowOverride of httpd.conf is not set to All。But after this time,卻變成 403 Forbidden,And all the pages can't enter,Regardless of whether the page URL is used for rewrite,researched for hours,Finally found the reason。


To use URL Rewrite,The following setting values ​​need to be set:

1. Apache – LoadModule rewrite_module
2. Apache – Options FollowSymLinks
3. Apache – AllowOverride All
4. .htaccess – RewriteEngine On


And my problem is that the above four have been set,卻出現 403 Forbidden,Among 2. 跟 3. I tried both in httpd.conf and httpd-ahssl.conf。


In order to simplify the test environment to clarify the problem,I left only the line RewriteEngine On in my .htaccess,and put the archive in the htdocs root directory。Also make a test.php file,Follows,Simply display php environment information,This file is also placed in the htdocs root directory。



When browsing http://abc.com/test.php,also appear 403 Forbidden,When querying Apache's error.log,You can see errors like this:

Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : C:/Web/Apache24/htdocs/test.php


Therefore, the scope of the problem can be narrowed down to the parameter FollowSymLinks。After confirming that httpd.conf is set correctly FollowSymLinks,I started reviewing and comparing the httpd.conf differences between the old and new sites one by one。Later I noticed that the new site was referencing httpd-ahssl.conf except in the SSL part (Include conf/extra/httpd-ahssl.conf) out of profile,The FastCGI part also references the external httpd-fcgid.conf (Include conf/extra/httpd-fcgid.conf) profile,That is to say, the settings of my old website are all in httpd.conf,But the new site uses three profiles(httpd.conf、httpd-ahssl.conf、httpd-fcgid.conf)。where httpd.conf and httpd-ahssl.conf I have tried,So the crux of the problem should be in httpd-fcgid.conf。


Open httpd-fcgid.conf,In Find Options at the bottom,The preset has only one ExecCGI parameter,After adding FollowSymLinks,restart Apache,problem finally solved。



3 Responses

  1. Anonymous Says |

    Is FortiGate 50E 6.2.10 the best?



  2. Anonymous Says |

    Is FortiGate 50E 6.2.10 the best?


    Anson Reply |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.