My drupal site has a .htaccess file on which I am redirecting the page without changing the URL.

It's working fine on local server & other servers but when I upload the files & databases to pantheon server It will not redirect the page saying 404 not found. I placed .htaccess at the root of code folder, I tried placing it in server root folder, sites/ folder & themes/ folder but nothing works for me.

Does anybody know what is the correct placement of .htaccess in a Drupal site on Pantheon? And why my .htaccess is not working on Pantheon?

1 Answer 1


Because Pantheon servers use Nginx, and they don't enable .htaccess support.

You should contact them directly to discuss your options (if you're lucky and/or have a high enough subscription they'll probably add some custom rules to the nginx conf for you).

  • Oh man its not fair. They say use settings.php to use any redirects etc. Can you tell me how I can redirect silently using settings.php.
    – Revolution
    Commented Apr 16, 2015 at 15:10
  • Simple redirect using setting.php working fine but its not silently redirect i.e. it changes the URL also.
    – Revolution
    Commented Apr 16, 2015 at 15:10
  • A redirect is never transparent, it'll always take you somewhere else (by design) - what you're looking for is a rewrite, and that is more often than not done at the server level. You could theoretically hack something together using $_SERVER vars to change the internal path before Drupal is even bootstrapped, but exactly how you accomplish it depends on a bunch of things. I'd advise opening a ticket with Pantheon and asking them to let you inject rules into their server conf. Drupal also has api.drupal.org/api/drupal/modules!system!system.api.php/…
    – Clive
    Commented Apr 16, 2015 at 15:16
  • I have opened the ticket & get the following comment on that: We have an optimized and standardized nginx configuration that is integral to the platform, so we can’t make changes for individual sites. I think you may need to find an alternative way of achieving this.
    – Revolution
    Commented Apr 16, 2015 at 15:19
  • 1
    That's a shame. They've offered to do it for me in the past, but that was on an enterprise package. The server setup may be different for those accounts
    – Clive
    Commented Apr 16, 2015 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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