Internal URL rewrite no longer working after upgrading Apache to 2.4

前端 未结 4 1690
迷失自我
迷失自我 2020-12-03 17:35

I need to internally rewrite the base URL so that instead of / being mapped to /index.php (default behaviour) it goes to another script named contents.php. I have a simple .

相关标签:
4条回答
  • 2020-12-03 17:39

    This is a known bug in Apache 2.4. I used the workaround provided here and it's working now.

    0 讨论(0)
  • 2020-12-03 17:40

    I had problems with SEO links (Prestashop site to be exact). Option was to add

    AllowOverride All 
    

    in virtual host's directory:

        <Directory /srv/path_to_public/public_html/>
                AllowOverride All
        </Directory>
    

    From apache docs:

    http://httpd.apache.org/docs/current/mod/core.html#allowoverride AllowOverride None (2.3.9 and later), AllowOverride All (2.3.8 and earlier)

    0 讨论(0)
  • 2020-12-03 17:43

    I also had 404s with WordPress redirects on virtual hosts after upgrading to Apache 2.4.6

    In my case problem was solved by changing 'AllowOverride None' to 'AllowOverride FileInfo' for each virtual host directory config.

    0 讨论(0)
  • 2020-12-03 18:06

    I have stumbled upon this very annoying issue as well. The solution is to disable MultiViews in httpd.conf, by adding -MultiViews for needed directory, for example:

    <Directory /home/example.com/public_html>
        Options -Indexes -MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    

    After that, rewrites started to work expected way.

    Don't forget to reload Apache after editing configuration files.

    0 讨论(0)
提交回复
热议问题