Redirect HTTP to HTTPS but this time with the WWW!

Well, I was not a 100% happy with the way the redirect was working when I initially set it up.

Any HTTP traffic heading to the site would get redirected to HTTPS but only if someone visited the link by using the naked domain ‘’.

Plus, I had a little bit of tinkering to do to the site as well. I wanted the ‘www.’ prefix working. Unfortunately if the ‘www.’ prefix was used, an error would appear. Something to do with Cloudflare but that is a topic for another post. By the way, if you don’t use Cloudflare, I highly recommend it! Link ->

I got the ‘www.’ prefix for the website working but the redirects were still not working as they should. If someone visited then it would redirect to but not to

Bit of searching and I came across this lovely snippet on StackOverflow:


It works like a charm! The balance in the universe has been restored! Yay!

DFS-R Having a Bad Day?

Well, first things first, don’t PANIC!

Arm yourself with the following command dfsrdiag replicationstate,look at the Windows Event Logs and DFS-R Debug logs located in C:\Windows\Debug.

They provide a wealth information.

Just as a reminder for myself I am going to include some resources below. Might come back and expand on them another time.

1. Checking for backlogs:
dfsrdiag backlog /rgname:rgroup_name /rfname:folder_name /sendingmember:sending_server

2. Setting verbose logging for DFSR logs:
wmic /namespace:\\root\microsoftdfs path dfsrmachineconfig set debuglogseverity=5

3. Translate GUID into file names. DFSR usus GUID to identify replicated files:
dfsrdiag guid2name /guid:guid_identifier /rgname:group_name

4. Getting the GUID’s of replicated folders:
wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderconfig get replicatedfolderguid,replicatedfoldername


5. What is DFSR currently up to? –

6. Useful succint DFSR Troubleshooting notes with EventId’s –

7. DFSR Event ID 2212 –

8. Understanding DFSR Dirty (Unexpected) File Recovery –

9. Understanding DFSR Debug logs. A great 21-part series on DFSR and Debug logs. Part 1 –