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:

<Directory />
    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)


The Directory / directive defines the base rules for all directories on the system. Usually after defining a Directory / directive, you have a Directory /my/web/root/here directive with more liberal configuration settings.

Do not confuse Directory / to mean the webroot of your web site, this is not the case.

Your re-write rules should be applied either inside of the Directory /my/web/root/here directive, or the VirtualHost for the particular site (if you are using VirtualHosts, very common).

Changing AllowOverride to All in Directory / may be overwritten by a defined Directory /my/web/root/here, or a VirtualHost for the site in particular.

Perhaps if you could pastebin (http://www.paste2.org/) the entire Apache configuration, we could get a better idea of the issue.


The Apache user should have read access to the .htaccess file.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.