How to activate mod_rewrite?

前端 未结 6 1494
小蘑菇
小蘑菇 2020-12-16 19:17

I know that this question have been asked several times. But I can\'t get it to work.

I installed Apache2 in my Ubuntu server I can also confirm that mod_rewrite is

6条回答
  •  孤城傲影
    2020-12-16 20:10

    Okay, let's check assumptions:

    1. Put nonsense in your Apache config files (and restart Apache to let them take effect), does Apache "complain" on restart? Then it tries to load those files. Try this for every Apache config file you can find. You now have a complete list of Apache config files that are loaded.

    2. put nonsense in your htaccess, reload the page, do you get a 500 error? If not, the htaccess is not getting loaded.

    3. Put the most basic mod_rewrite statement in your htaccess:

      Options +FollowSymLinks RewriteEngine On RewriteRule ^.*$ test.html

    This should rewrite every request to test.html.

    Try this and give us the results.

提交回复
热议问题