The British Caving Association

Any views expressed are not necessarily those of the BCA
It is currently Sat 25 May 2019 20:07

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri 17 Jun 2016 09:54 
Offline
User avatar

Joined: Thu 16 Mar 2006 23:45
Posts: 477
for those migrating from britiac2 to britiac3...

Before you switch the DNS to point to the new server your new web pages are accessible as britiac3.miniserver.com/~username in "the usual way". However, for this to give you a proper view of your web site you must be using relative links, not absolute links. For example, you need to access your CSS file as (for example)

Code:
<LINK REL="STYLESHEET" HREF="index.css">

and not
Code:
<LINK REL="STYLESHEET" HREF="/index.css">

The reason for this is that any relative link will be interpreted as britiac3.miniserver.com/~username/somepage whereas an absolute link would be interpreted as britiac3.miniserver.com/somepage, which does not, of course, work.

It may be that your web site needs absolute links because of the way you have constructed it. That is certainly the case for me. In this situation you cannot test your site using ~username. Instead, the approach I have adopted, for my sites, is this...

  • In the DNS for your domain, create a sub-domain (e.g. newsite.mydomain.co.uk) that forwards to the IP address of the new server.
  • In the control panel for the new server, at http://britiac3.miniserver.com/cpanel, create a corresponding sub-domain for your site and specify the root location to be the same root as for your main site (so probably something like /home/username/public_html
Now you should be able to access your new site as newsite.mydomain.co.uk and all the links should work. To give public access to your new site, you just need to alter the DNS for mydomain.co.uk to also point to the new server.


Last edited by David Gibson on Thu 27 Apr 2017 17:29, edited 1 time in total.
de-stickified this older post


Top
 Profile  
 
PostPosted: Fri 17 Jun 2016 10:42 
Offline
Site Admin

Joined: Thu 29 Dec 2005 23:22
Posts: 298
Location: Axbridge, Somerset, UK
For those that don't have easy access to the DNS I have heard tell of a solution that involves /etc/hosts.

I've not tried it before now because I've always had easy access to the DNS.

It is simply to add a record for the test domain to /etc/hosts or /windows/system32/drivers/etc/hosts (on windows) on your local PC. The /etc/hosts file is checked before the DNS and therefore overrides it. So for the above example add a line:

Code:
31.25.186.126       caving-library.org.uk


I just tried it and it works :D

Firefox needed a restart to recognise the change.

_________________
Dave Cooke
BCA Webmaster, BCA Web Services, National Cave Registry Co-ordinator, CSCC Treasurer


Top
 Profile  
 
PostPosted: Fri 17 Jun 2016 11:25 
Offline
User avatar

Joined: Thu 16 Mar 2006 23:45
Posts: 477
Ah yes, Id completely forgotten about that. If you use this method, do not a) forget that you have made the setting, or b) forget that you didnt also make it on the laptop youre currently using - Past experiences !!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group