How I can access the temporary URL the host provided (such http://server9.company.com/~myname as my domain or any other domain without tralling slash before DNS update?
For example: Access http://server9.company.com/~myname as http://www.example.com
I do not have a dedicated IP
If you are running a Windows OS then you can update your hosts file to include the desired name and the IP address of your shared hosting box.
In Windows 7 the file is located at C:\Windows\System32\drivers\etc\hosts There should be a couple of examples in the file but you basically want to add;
<ip of hosting server> www.example.com
If you are using a different OS please let me know so I can update the answer.
Related
In the office, we have already setup a redirect in the DNS to push .dev back to the localhost. The issue is when I am not in the office this does not work. I edited my host file for the websites but as I add more in the future I would prefer to not have to edit my host file.
Is there a way, within my computer, that I can force the TLD of .dev to always go back to my localhost?
I realize I may have to find a way to do this on my router so that the DNS is resolved.
Example:
- Local IIS
-- Website A (with a Host Name Binding of website-a.dev)
-- Website B (with a Host Name Binding of website-b.dev)
When I open a browser on my local box and type in website-a.dev, it should loop back to my local IIS and pull this website. Same thing for website-b.dev, of course, going to the other website. Now I know if at work we have setup the DNS to allow for this but I want to know if this can be done at home, where I do not have direct access to the DNS.
I know I can just put into my host file
127.0.0.1 website-a.dev
But I want a catch all for .Dev to go back to 127.0.0.1
Take a look at:
https://superuser.com/questions/135595/using-wildcards-in-names-in-windows-hosts-file
It explains that using Acrylic allows you to use wildcards and acts just like your host file.
I have a Linode server operating under a single IP Address. I access various websites via the single IP addresses in the following format: http://x.x.x.x/mysite1
Is it possible to access my individual websites, mysite1 etc, via names set in /etc/hosts?
In /etc/hosts I tried setting:
x.x.x.x dev.mysite
But, attempting to access my website via http://dev.mysite results in a webpage not found error.
Is what I'm trying to accomplish possible?
As long as you have made the /etc/hosts modification on the machine that is trying to access the website, then yes this is possible. Although you will also have to modify your Apache config so it knows which website to display when "dev.mysite" is requested. My Apache knowledge is rudimentary but I believe you want VirtualHost for this.
If you want other people to access the website without modifying their hosts file, you will need to buy a domain. For instance, if you buy xyz.com, you can put your sites under site1.xyz.com, site2.xyz.com and so on.
I believe Your /etc/hosts needs no change . dev.mysite already points to mysite.com which has an entry in /etc/hosts
You need to modify your web server (nginx / Apache)listening in port 80 to accept requests on dev.mysite
For the default Web Site in IIS I have the following binding on the default website:
I have the following binding on the site I want to access:
When I access the site in the browser with localhost/hostname, I'm pointed to C:\inetpub\wwwroot*hostname*. I have another site set up with a hostname binding that uses the same values for Port and IP Address and it points to the right place (a different folder on my C: drive). I'm running my site locally and I have the correct hostname entry in my hosts file. I don't want to create two separate virtual directories under a single website, I want the sites to be available as separate websites. What am I missing?
When you use the hostname feature in iis, you cant use localhost to access the site any more.
Instead use http://myhostname and setup myhostname to point to 127.0.0.1 in your hosts file.
If you want to access the site via localhost, that implies you need to make a virtual directory, or "application" in iis.
I'm looking to figure out how to replicate the functionality of GoDaddy's PreviewDNS when I'm moving a site to my own web host based in cpanel.
My setup is this: I have a wordpress multiuser site setup with a subdomain install, and a wildcard redirect.
I can't figure out how I can preview the website for an account before the DNS is switched over to my host from the old host.
I've been able to sorta do this by creating an A record of a subdomain over to my host, but I still have the issue of not being able to test the actual files instead of a copy in a subdomain.
I have two IP addresses attached to the server, one to the server itself and all the shared domains, and the other dedicated to the WP multisite.
When I go to http://ipaddress/~username/, I either get an error, or get redirected to the wordpress multisite's default "this site doesn't exist, sign up now to create it" page. I've tried this with both IP addresses with no avail.
Any ideas?
I think what you're trying to do is ensure that everything is working on the new server before having the DNS globally changed for all users? You could change your local computers hosts file to point the domain (and any subdomains you wish to test) over to the new dedicated IP address, which is essentially moving the DNS over for just yourself.
Here's a pretty good guide on how to do it: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/
I want to change my hosts file to redirect a web address to my site...
normally I would just do... ping mysite.com then in the hosts file, if the IP came out as 99.99.99.99, I'd write...
99.99.99.99 siteiwanttoredirect.com
But in this case my site is on virtual shared hosting... which means the IP I get back from the ping is the same as a few other sites and if I type that IP in the address bar, www.mysite.com won't come up. Here's a bit more details: someone who asked a question about why pinging it wouldn't give the correct IP.
So what I would like to know is... if you're on virtual shared hosting, how can you specify redirects to your site in the hosts file?
Thanks,
Matt
You cannot. With the hosts file you can change the IP address, but your shared hosting provider needs the HTTP Host header to be set up correctly -- which in your case will still be siteiwanttoredirect.com and not mysite.com . Your hosting provider will therefor not know who's site to show.
What you could do is redirect to some host you control (f.i. localhost) and run a proxy server there. If you set up Apache on your machine, with a virtual host for siteiwanttoredirect.com which does a reverse proxy to mysite.com , it should work.
This is handled via the host header of the website, and not anything on your local machine, like your hosts file.
I would make sure your host has that set up, then as long as people visit your sit via the website name, and not IP, everything should work.
On a shared host, the website you get is determined by the domain name you ask for thanks to the Host HTTP header. For this to work properly the web server needs to be configured correctly so it knows what website to serve in response to which Host request - this is usually called 'Add-on Domains' on CPanel driven shared hosting.