hello folks,

Installed and designed a drupal site using this ip address before the domain name was resolved :http://208.86.157.86/~trinityp/ , thinking that I could develop the new site in drupal using
the ip, and switch the name over when the site was ready (so the old site could continue to live on until the new was finished), However now I'm having trouble, as drupal is not using the domain name correctly (trinitypca.info).

In other words, I installed, themed and configured drupal using this http://208.86.157.86/~trinityp/ and I switched the name over to this: http://www.trinitypca.info . So the site is still using ~trinityp but I don't want it to.

In other words, how do I change the base path?

Any suggestions?

Thanks for any help.

Jonas

Comments

jtjones23’s picture

This has nothing to do with Drupal. You need to point your domain name to the folder that has the new site. If the new site lives in ~trinityp, then the domain name needs to point to that folder.

Your web host's support team should have a more detailed answer for you.

joecanti’s picture

Many web hosts give you a custom address similar to the one you show there until your domain name has propagated. Is this what happened to you?

My temporary address, which looks like yours, points to the root of the web hosting. I would image yours does too, although as the first poster said it may be in a sub folder.

If your installation is in a sub folder you just have to point your domain at the sub folder rather than the root. This can be done in cpanel by using the add domain function.

Another thing to check is the settings.php file and/or your htaccess as there are base URL settings located here - although if you didnt change them probably best not to make any changes to them.

Another thing to try is to clear the caches. I have often found that when moving from a temp domain to my real domain that links and things are off because of this sub folder appearence. So go to the performance page by typing into the url bar, and not navigating there through the Drupal menu system.

Eg type www.yourdomain.com/admin/settings/performance - scroll to the bottom and click clear all cached data.

Joe

jive01’s picture

Hey Joecanti, It is a custom address provided by host until the name is propagated and not a subfolder. I modified my settings.php folder to use the base to the domain, with some success,
however, now I am having a clean url issue and I suspect it might have to do with my htaccess file. In order for clean url's to work before, I had to use this in my htaccess file:

RewriteBase /~trinityp

# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

I can't login to my admin panel now to recache...

tomassiro’s picture

I'm having the exact same problem on Drupal 7. I built the site using ipaddress/~username and now when I changed the nameservers it shows mydomain.com/~username any ideas?

joecanti’s picture

It could be that your base URL is set in the settings.php, but most probably the url is stored in your cache. Have you cleared the cache?

sometimes you cant get there because the links don't work, so just go to mysite.com/admin/config/development/performance to get to the performance page, where you can clear all the caches.

Cheers, Joe

tomassiro’s picture

Thanks for the reply! I've tried everything. I've cleared the cache, and set the base_url in settings.php, and nothing seems to work. Also when I go to the configuration page, and then Site Information I can see the /~username in the path to the front page even. My drupal files are in the root of my site, but I can't get rid of that user folder. Any other ideas would be greatly appreciated. Is there anyway to hid the folder in htaccess?

joecanti’s picture

htaccess could be good for you - it sounds like you want to modify the RewriteBase to tell Drupal where your site is.

Find this part in the htaccess file and uncomment the "# RewriteBase /drupal" line and change /drupal to your extension...

So it will end up something like "RewriteBase /~username

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

All the best, joe

tomassiro’s picture

I hope others find this. This is what I did:

1. Disabled clean urls
2. Downloaded a stock .htaccess file
3. Uploaded the stock .htaccess file to the root directory
4. Changed the base_url setting in the settings.php file to 'http://mydomain.com'
5. Enabled clean urls, and BAM! it's all good.

I enabled clean URLs during the install and configuration with the ip address, so it was locking in the /~username directory to the url, so you have to release the Clean URLs, and then re-enable.

joecanti’s picture

Good!

Glad you got to the bottom of it.

Joe