Change domain name WordPress, the SEO friendly way

Change domain name WordPress, the SEO friendly way

How to change domain name of your WordPress site the SEO friendly way, without losing PR and link juice

I recently changed domain for this blog from to There are two parts of changing your domain or moving your site to a new host and domain – the technical part, and the SEO part where you try to preserve your search engine rankings. Doing it the right way will save you a lot less trouble in the future, and make you keep most of your hard earned SEO work. On the other hand, doing it wrong can have fatal consequences on your rankings in the search engines.

I’ll narrow it down and describe how I did it, and how you should do it too.

In my case I wanted to change domain from to on a running WordPress site. I was not switching host/server, but just wanted to “rebrand” my site with a new domain. Whether you are in the same situation and want to rebrand your site, or want to switch host and domain, you can use these steps as a guideline.

I’m currently running this blog on IIS in a Windows Server environment, but the fundamentals are the same, and the following steps can be incorporated, should you run your site/blog on Apache, Nginx or on a LiteSpeed server in a *nix environment.


Before starting out, I want to stress that changing your domain from to will affect your search engine rankings in the beginning. After you do a switch Google will index both of your sites, where after will slowly dissapear from the search results. I’ve had pages indexed with meta titles and descriptions chosen by Google, instead of the meta-data I chose for the pages (yeah, Google can do that). After the switch these pages are currently indexed with my new domain, and yet again Google has chosen meta titles and descriptions, though different (and much worse) than before. I had top 1 placements in Google with feature images and snippets, which are now gone after I changed domain. It’s a part of the process, but I’m positive the rankings and feature snippets will come back up, when everything is rolled out completely. It’s inevitable for things like these not to happen, as Google needs to reindex your whole site again. Don’t put too much concern into this though, as things will smooth out, and if you play it right, you’ll be back up where you were before. That’s what this guide is about.

Table of content

1. Domain name
2. Site and bindings
3. Change WordPress address
4. 301 redirects
5. Rename SQL database
6. Add properties in Google Search Console
7. Change address in Google Search Console
8. Submit sitemaps in Google Search Console
9. Update Google Analytics account and tracking code
10. Fetch site and submit to index
11. The afterwork

Read More

Redirect file to URL IIS

With this rewrite rule in your web.config, it’s possible to redirect a user from a specific file to an internal or external URL.
When they enter, they will be redirected to

Note that this requires you have URL Rewrite installed on your IIS.

Place the following rule inside:

Your rule goes here…


Rewrite rule:
<rule name="Redirect file to external url" stopProcessing="true">
<match url="^~/folder/filename\.html$" />
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<action type="Redirect" url="" appendQueryString="false" redirectType="Permanent" />

Enable WCF Windows Server 2012

If you didn’t install HTTP-Activation for WCF Services, you will get a 404 error when trying to access your service directly.
To be able to run HTTP WCF Services, do as follows:

1. Run Server Manager from your task bar or start menu
2. Choose the server you want to install WCF on
3. Scroll down to “Roles and Features” from task drop down
4. On “Add Role or Feature Wizard” dialog, click down to “Features” in the list of pages on the left
5. Expand “.NET 4.5” – if you haven’t installed it already, go back to “roles” and install it first
6. Under WCF Services” check the box “HTTP-Activation”. You can also add other types (TCP, Named Pipes, etc) if you will need them
7. Click “Install”

Enable WCF Windows Server 2012

Configure / demote Active Directory Windows Server 2012

This tutorial will explain how to install and configure Active Directory (AD DS) under Windows Server 2012

Configure Active Directory Windows Server 2012

If you by accident configured you Active Directory (AD) with a wrong domain controller, you can demote / remove if by navigating to server roles > Remove Roles and Features > Active Directory Domain Services > Next, and you’ll be prompted with a validation error, where you can click “Demote this domain controller”. Choose this option and run the wizard. This will not uninstall the Active Directory service itself, but only the installed domain controller (

Redirect www to non-www IIS

This guide shows you how to redirect your site from www to non-www on server level with IIS 7.5.

www is actually a subdomain for your main domain (, which means both and will serve the same content, if you don’t redirect either to or the opposite way around. It’s highly recommended to do so, to prevent duplicate content. Which you prefer is entirely up to you, as it doesn’t matter in search engine rankings, as long as you choose one.

Fire up Internet Information Services (IIS) Manager by hitting CTRL+R and type inetmgr [enter]

Choose your site in the left menu and open up “Url Rewrite

Redirect www to non-www IIS

Click “Add rule(s)…”

Choose “Blank rule” under Inbound rules and click [ok]

Redirect www to non-www IIS

Give your rule a name, eg.: Redirect to non-www
Request URL: Match the Pattern
Pattern: (.*)

Open up the “Conditions” tab

Redirect www to non-www IIS

Condition input: {HTTP_HOST}
Check if input string: Does Not Match the Pattern
Pattern: ^domain\.com$ 

Redirect www to non-www IIS

Scroll down to the “Action” tab

Action type: Redirect
Redirect URL:{R:1}
Make sure Redirect type is set to “Permanent (301)

Redirect www to non-www IIS


Another option, is to add the rule in your web.config manually:

<rule name="Redirect to non-www" stopProcessing="true">
<match url="(.*)" negate="false"></match>
<action type="Redirect" url="{R:1}"></action>
<add input="{HTTP_HOST}" pattern="^domain\.com$" negate="true"></add>

Download Windows 8 & Windows Server 8

After I have been running Windows 8 Developer Preview since the launch, and Windows 8 Consumer Preview got released last week, I decided to download and test it as well. I have been very positive with Windows 8 Developer Preview as working station OS for normal web development and every day use. As a developer OS, Windows 8 ain’t ready yet, as it conflicts with eg. Windows Phone SDK and Silverlight SDK, to mention the ones I have tried.

Either way, I thought it would share some download links.

Windows 8 Consumer Preview ISO 32/64bit
Product key: DNJXJ-7XBW8-2378T-X22TX-BKG7J

Windows Server 8 Beta 64bit

Windows 8 official logo