force main domain become a subdomain?

5 months ago
i am new to nopcommerce

i bought windows server 2012 r2 vps

installed IIS and everything, the site works fine for now

my main domain is site.com

in iis bindings i have added shop.site.com

i need to force main domain site.com always become a subdomain like shop.site.com
if user types site.com it must go to shop.site.com
if user types site.com/about it must go to shop.site.com/about
and etc

by the way i added my domain to cloudflare and can edit dns settings there

please help me
5 months ago
I believe there are two ways that you can achieve the redirection you described
1) using the URL Rewrite module in IIS.
2) Set up a "Page Rule" in Cloudflare.
5 months ago
Hi,

Its easy. First ensure that both your domains are added correctly to your IIS server. And you need to use cloudflare Page Rules or IIS Rewrite module to add a redirect rules to achieve the redirection you need.

You need to create a rule like this..
    URL pattern: http://site.com/*
    Setting: Forwarding URL (301 - Permanent Redirect)
    Forward to: http://shop.site.com/$1

After configuring these page rules in Cloudflare, make sure that Cloudflare's DNS proxy is enabled to route traffic through their network, including HTTPS traffic.