1

My drupal site has a .htaccess file on which I am redirecting the page without changing the URL, Its 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. Can any body know what is the correct placement of .htaccess in drupal site on pantheon? & why my .htaccess not working on pantheon?

2

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 Apr 16 '15 at 15:10
  • Simple redirect using setting.php working fine but its not silently redirect i.e. it changes the URL also. – Revolution Apr 16 '15 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 Apr 16 '15 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 Apr 16 '15 at 15:19
  • 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 Apr 16 '15 at 15:36

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.