Access localhost site using a valid url - iis-7

I've done this before, but I've forgotten it. Basically, to mimic an actual website on my local machine, I did some stuff so I could access my localhost site using a valid url. I've now forgotten how to do this. :(
I remember it had something to do with IIS site bindings and the hosts file. Could anyone please guide me in the right direction?
Many Thanks!

You may add your 127.0.0.1 IP address on your host files with the host you'd like to mimic.
The file is located at %windir%/system32/drivers/etc/hosts
and the format is:
127.0.0.1 domain.you.want.to.mimic
You must edit this file as administrator.

Related

blank page with domain name inside

I set up a server on Ubuntu 20.04, installed and configured UFW and fail2ban, installed nginx, opened 80 and 443 ports. Created a config file for my domain and started the server. It works, but from my IP address (from which I set up the server), I cannot get to the site. When I request a domain, I get a white page on which my domain is written in plain text. But as soon as I register the domain and IP in the hosts file, the site becomes available. I see the problem only from my IP, from others - the site is available. I can provide server settings, but they are corny simple. The site is still pure HTML. Even php didn't install.
Help me find the problem, or at least a direction to fix it.
Thanks!
It might be related to cached DNS queries. Remove the entry from /etc/hosts file and restart your local machine.

Access wordpress website on localhost from remote network

I want to show my client the WordPress website on localhost being developed by me (it's still in the beginning stage, not ready to go live yet). This is what I have done so far:
- I have done port forwarding and have tested it (whenever I access my Xampp localhost from the remote network by entering my computer's ip, it opens up the localhost dashboard).
Now this where I'm stuck:
- Whenever, I specify a directory of website (in htdocs) on my remote network's url (like this: mycomputer's ip/folder's name it changes the url to localhost/folder's name and the page doesn't open).
How do I resolve this issue?
Add this line to your wp-config.php might help:
define('WP_HOME','http://your-computer-IP');
define('WP_SITEURL','http://your-computer-IP');
and comment or delete that line when your work from home.
But there's something can be improved. Try to some DDNS services and install their application to your local machine. After installed, you can access your computer from mymachine.ddns.net even you're home or not. So with below setting, you no need to edit anything when you change your work location.
define('WP_HOME','http://mymachine.ddns.net');
define('WP_SITEURL','http://mymachine.ddns.net');

Publish a test website in IIS windows 10

For testing/learning purposes I've been trying to publish a website(build in asp.net) in IIS on windows 10. I enabled everything, made everything as saw on Microsoft tutorials, and youtube tutorials, yet, it seems its not working.
I try to access it thru the Site name I specified, and IP. but its not working.
this is the error keep getting
"This site can’t be reached
projectmms.com’s server DNS address could not be found."
NOTE: projectmms.com is the name/url I specified for the website.
Why is this error keep showing up? I made everything as seen in those tutorials.
and have checked many answers here from other posts, followed the same suggestion and nothing is working. Any suggestion?
EDIT:
after made what few of you requested, this is what I get. This is not my asp.net website.
even tried projectmms.com/default.aspx , it shows that it didn't found the page.
any help?
This is what shows now
You need to add projectmms.com in your hosts file.
add this in C:\Windows\System32\Drivers\etc\host
projectmms.com Your_Server_IP_Address
That will work locally.
You need to add projectmms.com domain to your host file (windows\system32\drivers\etc\host) and forward to your local IP (127.0.0.1).
This should be a comment, not a reply as you give us little to no info.(but I need 50 rep in order to do so)
Is the IIS in your machine or a remote one.
Did you add the name in the DNS server or the HOSTS file.
Do you reach the machine by ping (hostname/ip)?
Did you start the ISS service?
P.S.Ask if you don't understand any of the above points.
Using IIS Express you can only local host access, you have come to enable IIS on Windows resources?
see
http://www.howtogeek.com/112455/how-to-install-iis-8-on-windows-8/
http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later

Simulate domains locally in ASP.NET /IIS7

I would like to simulate that my ASP.NET application is hist by say simdomain.com.
How can i do that easily?
Ideally I would like some kind of filter, so requests to certain domains are routed to localhost, and it should be easy to turn it on and off.
Edit the hosts file.
Run notepad c:\windows\system32\drivers\etc\hosts
Add the following line:
127.0.0.1 simdomain.com
Open IIS admin and add a "simdomain.com" website. So it knows the domain.
Try editing you local hosts file. The default location is %SystemRoot%\system32\drivers\etc\hosts in most Windows systems.
Then you simply add the line
127.0.0.1 simdomain.com
That should do it.
EDIT: Ah, and as Chakrit said: Open IIS admin and add a "simdomain.com" website. So it knows the domain.
This depends a bit on IIS version, but if I remember correctrly for IIS7 do as follows:
Run 'inetmgr', or access the IIS setings via the Control Panel.
In the menu on the left open 'Sites', and right-click on the site you want to access. Choose 'Edit bindings..'
Click add. Type: Http, IP Address: All Unassigned, Port: 80, Host name: simdomain.com then click OK.
Might as well make my answer correct, even if the post is a tad redundant. ;)
Maybe have a read of this SO discussion; "ASP.NET Development server or localhost IIS"

Local testing for sub-domains using Url rewriter, Asp.Net 2

I am using UrlRewriting.Net for url rewriting in Asp.Net 2 and IIS 5.1 (offline) and IIS 6 (online)
The application performs the following:
A url of the following nature: http://username.site.com is re-written as
http://site.com/Default.aspx?user=username
This works perfectly online. However, I would like to know how we could test this offline.
I have tried pointing the application to 127.0.0.1 via IIS and then putting username.site.com in the hosts file to point to 127.0.0.1 - but it does not work out.
The website loads up - but the querystring is not generated.
Also tried putting just site.com -> 127.0.0.1 in the hosts file and accessing username.site.com. But in this case, the website does not load (site not found)
Any ideas?
easy way to test this will be to edit your hosts file so that username.site.com points to 127.0.0.1, but you will have to do this for each user you want to test on each PC...
Okay.
I managed to get this working. Its simple if you think about it.
I got myself a DNS server, installed it on my system and configured it to serve me pages from 127.0.0.1 for site.com
If you are wondering, I used a DNS server called SimpleDNS from http://www.simpledns.com/
There is also a free BIND DNS server available from:
http://oldwww.isc.org/sw/bind/view/?release=9.6.1b1&noframes=1
But that was too much for me to configure at this point of time.

Resources