You are here
Home > Web Development > WORDPRESS Devlopment

301 redirect, www redirect, domain redirect through web.config

First create a web.config file in your root directory if it's not already there.  Second, put the following code into your web.config file. Case1: 301 redirect to <?xmlversion="1.0"encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rulename="Canonical Host Name"stopProcessing="true"> <matchurl="(.*)"/> <conditions> <addinput="{HTTP_HOST}"pattern="^domain\.com$"/> </conditions> <actiontype="Redirect"url="{R:0}"redirectType="Permanent"/> </rule> </rules> </rewrite> </system.webServer> </configuration> Case2: 301 redirect all domains to one domain name <?xmlversion="1.0"encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rulename="Enforce canonical hostname"stopProcessing="true"> <matchurl="(.*)"/> <conditions> <addinput="{HTTP_HOST}"negate="true"pattern="^www\.domain\.com$"/> </conditions> <actiontype="Redirect"url="{R:0}"redirectType="Permanent"/> </rule> </rules> </rewrite> </system.webServer> </configuration>

DIFREX Nexgen Expands and Advances Reactor & Technology Solutions

Chemical reactors are the most vital elements of the chemical industry, contributing significantly to the total plant cost, efficiency of production, pollution control, number of separation steps needed downstream and therefore to its ultimate profitability. Although the reactor is the heart of most process plants, it usually is treated as

Guest Post

Hi, This is Eric Alonzi from I found your website very informative and have large number of articles on it. I am also from the same arena and I have been blogging about “<a href="">Charlottesville Web Design</a>” for last 5 years and own vast experiences on it. I see, you are

Goldcash Limited

We are offering a quick and easy process to get instant cash for your Gold Jewelleries using our services. GOLDCASH LTD. is one of the fastest growing gold buying Company with a number of branches across India. It is a practice across India where people pledge their gold jewellery to meet

How to create c-panel Cron jobs for your wp-cron jobs

Learn how to setup a real cron job for your WordPress scheduled tasks Because WordPress has to work on all sort of different platforms, OS's and configurations, it can't rely that there will be a cronjob service on the server that can handle scheduled tasks. This is why WordPress developers have