How to enable mod_rewrite for Apache 2.2

后端 未结 15 1328
渐次进展
渐次进展 2020-11-21 07:09

I\'ve got fresh install of Apache 2.2 on my Vista machine, everything works fine, except mod rewrite.

I\'ve uncommented

LoadModule rewrite_module mo         


        
15条回答
  •  借酒劲吻你
    2020-11-21 07:16

    The first time I struggled with mod_rewrite rules ignoring my traffic, I learned (frustratingly) that I had placed them in the wrong , which meant that my traffic would ignore all of them no matter how well-written they were. Make sure this isn't happening to you:

    # Change the log location to suit your system. RewriteLog /var/log/apache-rw.log RewriteLogLevel 2

    These parameters will activate if you perform a graceful restart of Apache, so you can recycle them in and closely monitor the mod_rewrite behavior. Once your problem is fixed, turn the RewriteLogLevel back down and celebrate.

    In 100% of my experience, I've found that the RewriteLog has helped me discover the problem with my rewrite rules. I can't recommend this enough. Good luck in your troubleshooting!

    Also, this bookmark is your best friend: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog

提交回复
热议问题