Skip to content

Instantly share code, notes, and snippets.

@lmakarov
Last active February 10, 2018 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmakarov/8fbf43db3cbe2453febaa1e4aa46228a to your computer and use it in GitHub Desktop.
Save lmakarov/8fbf43db3cbe2453febaa1e4aa46228a to your computer and use it in GitHub Desktop.
Overriding $base_url in Drupal 7
<?php
/**
* Base URL (optional).
*
* If Drupal is generating incorrect URLs on your site, which could
* be in HTML headers (links to CSS and JS files) or visible links on pages
* (such as in menus), uncomment the Base URL statement below (remove the
* leading hash sign) and fill in the absolute URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
$base_url = 'http://www.example.com'; // NO trailing slash!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment