| View previous topic :: View next topic |
| Author |
Message |
Josheh Expert Cheater
Reputation: 1
Joined: 28 Aug 2011 Posts: 155
|
Posted: Tue Sep 13, 2011 5:52 am Post subject: How can I edit my hosts file? |
|
|
To get a certain webpage to redirect to a document on my laptop?
In my hosts file I have:
| Code: | # Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
C:\Users\Josh\Documents\Minecraft.txt http://www.minecraft.net/haspaid.jsp?user=Josh |
I want the MC link to redirect to a text file and read its contents instead of the contents displayed on the webpage.
Also sorry if this is the wrong section, but I couldn't find a suitable one.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Sep 13, 2011 4:20 pm Post subject: |
|
|
You need to redirect to an actual web server, not a document. Setup a local web server on your machine and redirect the target machine to yours.
| Code: | | 127.0.0.1 minecraft.net |
Then mimic the location of where it is attempting to find the file. So on your webserver, with that link you show, you will need to have a file on your local server to match that.
So:
http://localhost/haspaid.jsp
You will need to make that valid so when the game attempts to hit the original server and is redirected via your host file, the new page is valid.
_________________
- Retired. |
|
| Back to top |
|
 |
Josheh Expert Cheater
Reputation: 1
Joined: 28 Aug 2011 Posts: 155
|
Posted: Tue Sep 13, 2011 4:25 pm Post subject: |
|
|
| Wiccaan wrote: | You need to redirect to an actual web server, not a document. Setup a local web server on your machine and redirect the target machine to yours.
| Code: | | 127.0.0.1 minecraft.net |
Then mimic the location of where it is attempting to find the file. So on your webserver, with that link you show, you will need to have a file on your local server to match that.
So:
http://localhost/haspaid.jsp
You will need to make that valid so when the game attempts to hit the original server and is redirected via your host file, the new page is valid. |
Alright thank you very much!
|
|
| Back to top |
|
 |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Wed Sep 14, 2011 4:37 am Post subject: |
|
|
| But doing this he may/will have problems accessing other links on that site should he needs to and thus needs to modify his host file. The only solution I can think of for redirecting a specific URL is via proxy, IIRC. Meaning you have to setup a proxy between your system and the internet/router/firewall and configure the proxy to redirect that URL. Alternatively, you can also try some of those software made for parents filtering out URLs for their kids. I haven't tried that solution so I don't can't tell you how it might work.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Sep 14, 2011 6:34 am Post subject: |
|
|
| mibiz wrote: | | But doing this he may/will have problems accessing other links on that site should he needs to and thus needs to modify his host file. The only solution I can think of for redirecting a specific URL is via proxy, IIRC. Meaning you have to setup a proxy between your system and the internet/router/firewall and configure the proxy to redirect that URL. Alternatively, you can also try some of those software made for parents filtering out URLs for their kids. I haven't tried that solution so I don't can't tell you how it might work. |
Any request made to anything part of the redirected URL will pass through the local web server. If it is not what is needed, it can just be passed through, acting like a proxy. No need to setup extra crap that isn't needed when it can be done via the web server as well.
_________________
- Retired. |
|
| Back to top |
|
 |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Thu Sep 15, 2011 6:59 am Post subject: |
|
|
| Wiccaan wrote: | | mibiz wrote: | | But doing this he may/will have problems accessing other links on that site should he needs to and thus needs to modify his host file. The only solution I can think of for redirecting a specific URL is via proxy, IIRC. Meaning you have to setup a proxy between your system and the internet/router/firewall and configure the proxy to redirect that URL. Alternatively, you can also try some of those software made for parents filtering out URLs for their kids. I haven't tried that solution so I don't can't tell you how it might work. |
Any request made to anything part of the redirected URL will pass through the local web server. If it is not what is needed, it can just be passed through, acting like a proxy. No need to setup extra crap that isn't needed when it can be done via the web server as well. |
In using the local web server as you say, if accessing other non-configured URLs, he'll get 404 unless he has some kind of rewrite mod in place with the rules configured.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Sep 15, 2011 1:54 pm Post subject: |
|
|
| mibiz wrote: | | Wiccaan wrote: | | mibiz wrote: | | But doing this he may/will have problems accessing other links on that site should he needs to and thus needs to modify his host file. The only solution I can think of for redirecting a specific URL is via proxy, IIRC. Meaning you have to setup a proxy between your system and the internet/router/firewall and configure the proxy to redirect that URL. Alternatively, you can also try some of those software made for parents filtering out URLs for their kids. I haven't tried that solution so I don't can't tell you how it might work. |
Any request made to anything part of the redirected URL will pass through the local web server. If it is not what is needed, it can just be passed through, acting like a proxy. No need to setup extra crap that isn't needed when it can be done via the web server as well. |
In using the local web server as you say, if accessing other non-configured URLs, he'll get 404 unless he has some kind of rewrite mod in place with the rules configured. |
He can setup rule-sets to pass any unknown request back to the original server while still catching the ones he wishes to handle manually.
_________________
- Retired. |
|
| Back to top |
|
 |
|