Testing your files on the new server
Posted: Fri 17 Jun 2016 09:54
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)
and not
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...
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: Select all
<LINK REL="STYLESHEET" HREF="index.css">
Code: Select all
<LINK REL="STYLESHEET" HREF="/index.css">
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