Forum Moderators: phranque
You see, until I switch my domain name over I need to temporarily access my site using the direct path from my host's domain name (hostdomain/~username/).
Unfortunately, this breaks my site as references to root now go to the host's main site instead of the my own site (/mypicture.jpg becomes hostdomain/mypicture.jpg instead of hostdomain/~username/mypicture.jpg).
Is there a way I can change something temporarily, by .htaccess perhaps, in order to test the site before I start sending accesses from my domain name there?
It seems like this would be a common problem, but I've searched everywhere and have had no luck whatsoever. I'm at a complete loss. Any suggestions would be appreciated.
I'm afraid that .htaccess cannot help in this situation, because the .htaccess file would have to reside at hostname.com/.htaccess, and shared access at that level would make all accounts quite insecure.
Jim
The "PHP include path" is defined in the .htaccess file and this makes the site totally portable to a new host and domain. It also allows testing on a localhost machine, either as localhost or as a fake "test" domain name forced through the HOSTS file on the PC.
For any non-canonical domain, a meta robots noindex,nofollow tag is forced for all pages, and GA code is also suppressed by a couple of lines of PHP in a common "include" file.
10.11.12.13 www.example.com Your hosts file is found at
c:\windows\system32\drivers\etc\hosts if you are running XP - open the file in notepad. Then you can access your site on the new server by using your usual domain name. Just comment out the hosts file entry when you need to access the site at on the old server.
I did however, come up with a solution. I have a second domain that's currently unused, so I just parked it at the new host. The DNS servers updated overnight and I was able to verify that everything is working.
Thanks for all the help and suggestions. You guys are great.