This is somewhat linked to this question. I have 2 Drupal 7 sites hosted in subfolders, one of which is intended to be a production site (public_html/site1) and the other is the testing site (public_html/site1-test).

The main url (i.e., site1.com) should be shown when accessing the production site. When I go to my main url, it shows correctly. However, all links and content are shown via the subfolder (e.g., site1.com/site1/content/... rather than site1/content).

To facilitate the change, I updated the $base_url variable in the settings.php file to serve the base URL (i.e., site1.com) and that completely breaks the site. The theme stops showing, logins don't work, etc.

Is there a way around this problem? The main site should mask off the subfolder in the url, however I don't think I can do that without updating the $base_url


Try setting your base URL in settings.php like

$base_url = 'http://site1.com';  // NO trailing slash!

And in your .htaccess file set RewriteBase to:

RewriteBase /site1


RewriteBase /site1-test
  • Didn't work...site was still broken. – the_e Apr 5 '15 at 3:51
  • I have actually tried this answer in the past, so I assume its a common fix. If this still breaks site functionality, do you know if the problem is htaccess-related, or Drupal-related? – the_e Apr 6 '15 at 14:02

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.