Tuesday, November 22, 2016

apache 2.2 - rewriterules +httpd.conf +.htaccess problem (urgent-site down)



I'm migrating one of my websites from dreamhost shared to dreamhost ps.
the files copied OK and DNS resolved to the new server. However trying to get a pagw brings error 403 access forbidden.




If I remove the .htaccess file from the directory of the site. the homepage loads OK but naturally any other page does not (because it requires rewriting currently defined in .htaccess).



I believe that httpd.conf blocks usage of .htaccess in the new server. quote:




Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all




I tried removing htaccess and implementing the rewrite rules in httpd.conf. without success.



My questions:
1. I tried AllowOverride All to make .htacces work. It didn't change anything. What else should be checked/done to make it work?




  1. I created a directory section in httpd.conf with the directory in which the httpdocs sit and put all the rewrite rules there. (and restarted the server). it didn't have effect. Any hints on what should be done to add directory part with rewriterules to .httpd.conf and troubleshooting tips?


  2. How can I check if mod-rewrite is working on this server? It is enabled on the httpd.conf file. The server is on fastcgi mode.





Any other tips are very appreciated.



Thanks,
Niro



How can I move the rewrite rules in .htaccess in httpd.conf (and make it work)


Answer



Thanks for the answers. I finally discovered that the actual httpd.conf file was under another path, It was not visible due to permissions. Just in case someone need it it was at:




/usr/local/dh/apache2/apache2-psnum/etc/ (psnum is the server number)



I placed the rewrites there under the directory section of my site and everything works.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...