I've moved my site to a new host and am waiting for the DNS entries to update. In the meantime, I want to access the site using the IP address followed by the username on the account. All I get is the front page but none of the links work.

This thread is very similar:
http://drupal.org/node/101198
but it hasn't solved my problem.

I have added the ipaddress/~username entry as the baseurl in the settings.php file, but it's made no difference. I assume the site will work once the domain name is pointing to it correctly, but I'm hesitant to redirect it to the new site without knowing for sure. How can I test it?

--Brad

Comments

cog.rusty’s picture

Do some diagnosis. Hover over the menu links which don't work. What are their URLs like?
Do they use clean URLs or do they use "?q="?
Do they contain a domain name or a base path different from your home URL which works?

If the problem appears only when clean URLs are used, try settings RewriteBase /~accountname in .htaccess (and remember to remove it afterwards).

behindthepage’s picture

You can put an entry in your computers hosts file that will direct your browser to your new IP address when you enter a certain domain name. e.g.

202.60.46.254 www.newsite.com

will direct your browser to 202.60.46.254 when you enter the domain name "www.newsite.com in your browser.

On Windows (XP) your hosts file can be found here c:\windows\system32\drivers\etc\hosts.
Once you have entered it reboot your computer

For more info google "hosts file"

gpdinoz
"Everything should be made as simple as possible, but not simpler." - Albert Einstein

Regards
Geoff

bradnana’s picture

Thanks for the replies, but I don't think tinkering in .htaccess or host files would be the proper way to address the problem. Mainly because those files need to be correct when the domain propogates. But I think cog.rusty is onto something with the RewriteBase directive.

I should have mentioned that I'm using clean URLs. The base URL looks fine and the correct path is getting appended onto the base correctly. The full URI to each link looks perfect, but all I get is 404 pages on everything but the home page. In fact, I have other sites running Joomla that I migrated at the same time, and they run perfectly from the ip address/~username combination. So, I'm fairly certain it has to do with the way Drupal itself handles the base URL and the method used to distinguish it from the path.

Again, my question is not really how to get the domain name to resolve to the new ip address. Pursueing that would be an excercise in futility since it's going to happen anyway when the name propogates. Instead, I would like to know if it is possible to access a Drupal site using an ip address/~username combination (and not an ip address alone).

See for yourself:
The old site is at http://www.foremanar.com
The new site is at http://67.222.24.6/~foreman

I'm not worried about the broken images. They're a result of the HTTP protocol and the way the browser is appending the relative URL onto what it thinks is the base. I think this may be related to what Drupal is doing, too.

cog.rusty’s picture

Try RewriteBase /~foreman anyway. This is the only thing I would try in this case, since it affects how your correctly formed but virtual (non-existent) URLs are rewritten to real URLs.

In particular, this would make a difference if ~foreman is not a physical directory path but a server URL alias path.

Your clean URL support by the server setup is obviously broken. You moved the site with clean URLs enabled, but if you disable them Drupal probably won't let you enable them again until you fix the setup. Non-clean URLs work fine even now.

behindthepage’s picture

Hosts files are on your computer, not the web server and it is a temporarty fix that you delete when you redirect your domain name. I have used this for exactly the problem that you talk about. The problems you are having with your site will disappear when you redirect your domain name. Putting a line in your hosts file is the quickest and easiest way to access your site prior to redirecting your domain name.

gpdinoz
"Everything should be made as simple as possible, but not simpler." - Albert Einstein

Regards
Geoff

bradnana’s picture

Hey, thanks for the comments guys.

You're both right it appears. Plain URLs seem to work fine.

Would you say then that I could turn off clean URLs temporarily and the sites should work and that I should be able to turn them back on again later when the names fully propogate?

--Brad

cog.rusty’s picture

Sure (minus the image links which contain root-relative paths), you will be able to enable it again as soon as your server setup handles it correctly. Practically, that may mean "as soon as your domain name becomes accessible".

But I wonder why it hasn't already propagated after almost two days. It shouldn't have taken more than 2-6 hours.

If you have added the domain name to your 'hosts' file for your own convenience, don't forget to remove it when the domain name becomes accessible, so that you can see what other people see.

bradnana’s picture

Well... I only changed the DNS entries today. I was wanting to make sure the sites were running correctly on the new server before I moved the names. Hence, the reason I was trying to get around the clean URLs. But I went ahead and took the plunge and made the changes this morning. I hope you're right that it will only take a few days to propogate, but so many ISP's don't update their nameservers on a reasonable schedule. In the meantime, my clients are on hold and not able to update their sites.

Thanks for all the help.

--Brad