0

I have installed Drupal on shared hosting. Drupal is installed in the public_html folder of an Apache user directory (UserDir). Unfortunately, I notice that Drupal always defaults its administrative links to the root, for example: http://www.domain.com/?q=admin. I don't want this, since my site is located in the user directory. Therefore, I want Drupal links to look like: http://www.domain.com/~sitename/?q=admin. How do I get this to happen when the url contains a tilde?

Is there a setting(s) I can change to make a global adjustment?

Thanks in advance, Doug

  • Uncomment and change the Base URL in your settings.php file to include the full site URL with tilde and username – jsheffers Mar 19 '12 at 13:08
1

You have a variable ($base_url) for this in settings.php, in /sites/default usually.

Set $base_url to match the address to your Drupal site:

$base_url = "http://www.example.com/~stef";

Hope that helps!

PS: There is also a url setting in .htaccess you may want to look at if the above does not work.

  • It might be useful to add the .htaccess setting to your answer, just in case this solution does not work for other people looking at the same question in the future. – Chapabu Mar 19 '12 at 9:46
  • Yes, please let me know exactly what to do with the .htaccess, because I reset the $base_url, but am still having problems. – Doug Mar 19 '12 at 14:55

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.