Search code examples
iissubdomainmacos-windowserver

Windows IIS server subdomain through port 80 to point to subroute


I have two subdomains which are pointing to the same server:

  • kon.balaghlb.com -> 80.208.224.173
  • grahhic.balaghlb.com -> 80.208.224.173

I want to handle the two on port 80 inorder to be pointing like this:

  • kon.balaghlb.com -> 80.208.224.173/kon
  • grahhic.balaghlb.com -> 80.208.224.173/graphic

I tried to play around with inbound rules without no luck.

Any help how to acheive these routes on windows server with iis?


Solution

  • To achieve your requirement you could try below steps:

    • Open the IIS Manager
    • In the Connections pane on the left side, expand your server's name and select the website
    • In the middle pane, find the URL Rewrite feature and double-click on it.
    • On the right-hand pane, click on "Add Rule(s)..."
    • Choose “Blank Rule” under the “Inbound Rules” section and click "OK."
    • Add rule as shown below:

    enter image description here

    Repeat same steps for the another site and use rewrite url as "/graphic/{R:1}"

    Make sure you have a single website set up in IIS where you'll be hosting both subdomains and you should have the sub-folders kon and graphic in site root folder.