cancel
Showing results for 
Search instead for 
Did you mean: 

Migrate a website from Plusnet webspace to Microsoft Azure (Static Web Apps) - free in most cases

TimDSMoss
Grafter
Posts: 35
Thanks: 9
Registered: ‎08-02-2021

Migrate a website from Plusnet webspace to Microsoft Azure (Static Web Apps) - free in most cases

If you have a website hosted by Plusnet on their "webspace" system and you're looking to move it elsewhere,

in particular, if you want to do this at no cost,  then ...

 

"Microsoft Azure Static Web Apps" might be a viable option for you - it worked for me.

learn more about their solution here: (What is Azure Static Web Apps? | Microsoft Docs)

lots of nice benefits.

 

Follow the "Quickstart" guide(s) on the page linked above, and you'll have your site up and running very quickly.

 

If you have your own ("custom") domain name and this is registered with Plusnet and hosted on their DNS system, then things start to get a little bit tricker, if you want those domain names to take wbe users to your new site you just created on MS Azure Static Web Apps.

Just in case it helps anyone else trying this, or looking for an option, I thought I'd share how I got it working.

(FYI much of the below will also be relevant if you intend to use MS Azure App Service to run your new website)

 

Image your domain is "yourdomain.com":

As it stands, if someone enters "www.yourdomain.com"or just "yourdomain.com" into their browser, they'll see the website hosted on Plusnet webspace.

 

Getting "www.yourdomain.com" to take them to your new website on MS Azure is pretty easy.

First go to the "Manage your domains" section on the Plusnet member portal.

Add a new "CNAME" record with jus

- "www" in the left hand box (without the quotes)

- the name provided by MS Azure in the right hand box - but be sure to add a "." (dot) on the end of it.

Wait a while for this change to effect (can take 24 hours or so, but if done in the evening will typically be ready the next day)

NB. the site will be offline from the time the change above takes effect, until the time you complete the steps below

Then in the relevant place in the MS Azure portal

- add a "custom domain" to your web app

- enter "www.yourdomain.com" as it's name, and select "CNAME" as the verification method.

- it'll whir away for a minute or so, when complete (all going well) it'll all be working.

Entering "www.yourdomain.com" into a browser will now take you to the new MS Azure hosted web app.

It will work with both HTTP and HTTPS (secure protocol, which did not work on Plusnet webspace)

- MS Azure automatically creates an "SSL certificate" for your new site/domain anad will automatically renew it as and when needed.

 

So far so good! 🙂

 

However, if a user types in "yourdomain.com" into their browser (i.e without the www. prefix) then this will still ttake them to the Plusnet hosted webspace (the old website).

 

Sadly, you can't just repeat the process you did above.

 

Microsoft Azure Static Web Apps ask you to setup a new ANAME or ALIAS record in DNS for "yourdomain.com"

but

- Plusnet DNS system doesn't support these types of records.

- You can't use a CNAME record for the base/root/apex domain (i.e. "yourdomain.com" without the www.)

- Plusnet DNS system does NOT support "CNAME flattening" (a potential alternative suggested on the Azure porta)

 

Even if they did, then to verify the new record, MS Azure asks you to also create a new "TXT" record (using a unique code they generate for you)

- Plusnet DNS system doesn't support TXT records either

 

It may look like you'll need to migrate your domains out of Plusnet into another DNS provider

(e.g. GoDaddy), which takes time, a support call or two, and some money.

 

All is not lost though.

One solution without migrating the DNS domains is to

- configure your old Plusnet website, to "redirect" users to your new one.

 

To do this you can upload via FTP in the normal way a new text file to your Plusnet webspace.

It must be named ".htaccess" (with a leading "dot")

Put it into the old website's "root folder" (in your webspace on Pluset)

by default this is a folder named "/htdocs/"

 

I'd recommend creating a new text file on your local machine named just "htaccess"  (with no "." at the front and no ".txt")

Open/edit it in Notepad 

Add the below and the save it.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^.*yourdomain(.com|.co.uk)$ [NC]
RewriteRule ^(.*)$ https://www.yourdomain%1/$1 [R=301,L]

Next upload it into /htdocs/ on the FTP site for your Plusnet webspace

Finally, once it is there rename it to ".htaccess"

(ths may seem a bit convoluted, but once the leading "." is in place the file may be treated as "hidden" and disappear from view!)

 

With this file in place, if a user enters either "yourdomain.com" or "yourdomain.co.uk" into their browser,

they'll first connect to the old Plusnet webspace, but it will immediately "redirect" / bounce them on to a new URL with "https://www." in front.

Since you already (earlier on in the process) got the "www" subdomains working on MS Azure, the user is now taken to the new site on MS Azure (and helpfully by default, the secure HTTPS version).

 

 

 

PS.  Repeat all the above for each separate custom domain you have with Plusnet

- but you'll need extra logic/rules in the ".htaccess" file

I'm not going to go into that here, but if you get stuck then this is the reference guide for htaccess files:

Apache mod_rewrite Introduction - Apache HTTP Server Version 2.4

 

I think "that's all folks"!

Happy to clarify a bit if any of the above doesn't make sense.

 

kind regards,

 

Tim

1 REPLY 1
TimDSMoss
Grafter
Posts: 35
Thanks: 9
Registered: ‎08-02-2021

Re: Migrate a website from Plusnet webspace to Microsoft Azure (Static Web Apps) - free in most case

If you have just a single custom domain, (or happy for all requests to end up at the same single domain)

you can use a slightly simpler .htaccess file that would look like this:

Redirect 301 / https://www.yourdomain.com