Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

How to redirect a specific sub-domain to the main domain using web.config?

$
0
0

Currently I have a sub-domain 

https://blog.example.com

 which I would like to redirect to 

https://example.com/blog

https://blog.example.com doesn't exists anymore.

I'm using Craft CMS running on IIS 7 server.

I tried the code mentioned below but it didn't work:

<?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rule name="Redirect blog to new url" enabled="true" stopProcessing="true"><match url=".*" /><conditions logicalGrouping="MatchAll"><add input="{HTTP_HOST}" pattern=".*" /></conditions><action type="Redirect" url="https://example.com/blog/{R:0}" /></rule></rules></rewrite></system.webServer></configuration>

Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>