I faced a hair-tearing problem. Eu enfrentou um secador de arrancamento problema. mod_rewrite was loaded and yet it was not working in .htaccess files (and httpd.conf initially). o mod_rewrite foi carregado e ainda não foi trabalhar no. htaccess arquivos (e httpd.conf inicialmente). Here is the solution along with how you can debug mod_rewrite problems. Aqui está a solução, juntamente com o modo como você pode depurar o mod_rewrite problemas.

Debugging procedure: Depuração procedimento:
Add these two line to your httpd.conf immediately after RewriteEngine On . Juntar essas duas linha em seu httpd.conf imediatamente após Regravar mecanismo em.
RewriteLog “/var/log/httpd/rewrite_log” RewriteLog "/ var / log / httpd / rewrite_log"
RewriteLogLevel 9 RewriteLogLevel 9
After that I added the required RewriteRule etc. Depois que eu acrescentou o exigido RewriteRule etc

The reason for testing directly in httpd.conf is to ensure that mod_rewrite is working in the first place. A razão para o teste diretamente no httpd.conf é o de assegurar que o mod_rewrite está a trabalhar em primeiro lugar. After some debugging I realized my expression was wrong. Depois de alguns depuração eu percebi a minha expressão estava errado. So now I found mod_rewrite was working in httpd.conf. Então agora eu achei o mod_rewrite estava trabalhando em httpd.conf. However it still wasn’t working in .htaccess files. No entanto, ainda não foi trabalhar no. Htaccess arquivos.

Solution: Solução:
I found AllowOverride was set to None in httpd.conf. Achei que foi definido para Nenhum AllowOverride no httpd.conf. I changed it to All (after all I am the only user of the machine). O texto foi alterado para Todos (afinal sou o único usuário da máquina). And it finally started working everywhere (after a restart). E é finalmente começou a trabalhar em todos os lugares (após uma reinicialização).

What I learnt: O que eu aprendi:
Unmanaged dedicated web hosting is really really painful, unless you are (or have) a good linux system administrator. Não gerenciado dedicado web hosting é realmente muito doloroso, a menos que você é (ou tem) um bom sistema Linux administrador. Too many things to setup and too many points of failure. Há demasiadas coisas para configuração e também muitos pontos de fracasso. And I haven’t even started working on serious hardening stuff. E eu ainda nem sequer começou a trabalhar a sério endurecimento stuff.