I've got my new drupal site all setup and working at www.mydomain.com/newsite
I will move the old static html site to www.mydomain.com/oldsite
I want to use a symlink so that people coming to www.mydomain.com are automatically shown www.mydomain.com/newsite. I want to keep each version in these folders so that I can quickly and easily move the live version over to the old static version if we end up having a problem with the server load.
But I can't figure out how to set up a symlink from www.mydomain.com to www.mydomain.com/newsite
I've been using ssh:
ln -s public_html/newsite public_html (I get an error saying 'ln: public_html/newsite: File exists' - and I've chmod newsite to 777)
I've tried using full paths (usr/home/username/public_html) but get the same error.
Am I just doing something wrong? Is a symlink the correct way to do this? Or should I be using htaccess?
Thanks!
Thomas
Comments
Not quite...
A symlink isn't the best way to handle this. You want a server redirect, which can be done in many ways. Possibly the simplest is to have a blank index.php with the right header() redirect:
header("Location: {URL}");...where {URL} = "http://www.mydomain.com/newsite", but because of the automatic search/replace with the comment posting, I couldn't put it in there. It is recommended that you use an absolute URL instead of a relative path.
The symbolic link you were attempting is impossible, because it's a circular reference, and would have only worked if the destination symbolic link was located somewhere else.
Thanks!
Thanks for your help - I'll do it that way.
And if everything is working properly then I'll eventually just move the drupal installation to the root folder on the website and set up an htaccess redirect from the 'newsite' folder to the root folder.
__________________________
http://www.thomasturnbull.com
http://twitter.com/thomasturnbull