I am trying to practive URL rewrting and I came across few post that helped me out a lot but I am stuck on how to check it on machine before deploying me website to my hosting providder.
Here is what I want to do, user will type username.mydomain.com and it should rewrite as mydomain.com/id=username
Saw a post on
Stackoverflow and another
post which is in asp.net. I modified the code as below to fit my needs
If you want to access the website with hostName, you should configure your DNS server to add a record like this below
127.0.0.1 YOur Domain
Just for test, you can edit local DNS file %SystemRoot%\system32\drivers\etc\hosts . And then you should bind the host name to your
website. For more information, you can refer here
Member
9 Points
40 Posts
URL rewriting practice on local machine
Jan 09, 2014 01:13 PM|iworkonline|LINK
Hi
I am trying to practive URL rewrting and I came across few post that helped me out a lot but I am stuck on how to check it on machine before deploying me website to my hosting providder.
Here is what I want to do, user will type username.mydomain.com and it should rewrite as mydomain.com/id=username
Saw a post on Stackoverflow and another post which is in asp.net. I modified the code as below to fit my needs
as I am running on my local machine, what will be domain, is it going to be localhost(portnumber) and I will type user,localhost(portnumber)
Thanks for your help.
Star
9903 Points
1291 Posts
Re: URL rewriting practice on local machine
Jan 13, 2014 07:09 AM|Pengzhen Song - MSFT|LINK
HI,
If you want to access the website with hostName, you should configure your DNS server to add a record like this below
Just for test, you can edit local DNS file
%SystemRoot%\system32\drivers\etc\hosts
. And then you should bind the host name to your website. For more information, you can refer herehttp://www.orcsweb.com/blog/mark-newnam/how-to-set-up-site-bindings-in-internet-information-services-iis/
http://en.wikipedia.org/wiki/Hosts_(file)
And then we can test if the rule works.