Forum Moderators: mack

Message Too Old, No Replies

http://localhost & working offline

IE always wants to connect to the Net when I want to browse http:/localhost

         

AndyL

10:46 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



Hello

I am running WinXP, IIS, & IE 6.0

I am developing my website offline on my PC (C:\Inetpub\wwwroot etc.). Under Tools > Internet Options > Connections, my IE Connection is set to 'Always Dial my Default Connection'.

However when I click on a link to somewhere in my site (still 'local', not on the Net) an Internet Connection prompt fires up and suggests I connect to the Net or work offline. I click 'Work Offline' but every subsequent link in my offline website prompts me for an Internet Connection.

Have I missed a setting somewhere which will allow me to browse my website on my local PC (no need to connect to the Net whilst developing) but will also enable me to connect to the Net when I need to log into a forum, for example?

Many thanks,
Andy

skipfactor

10:56 pm on Feb 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, Welcome to WW.

Be sure this line is in your hosts file:
127.0.0.1 localhost

If it is, try surfing with:
[127.0.0.1...]

Turn off autodial:
Control Panel>Network & Internet Connections>Internet Options>Conntections Tab>"Never Dial a Connection"

AndyL

11:22 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



Thanks for your reply, but no joy!

This line is in my hosts file (C:\Windows\System 32\Drivers\etc):
127.0.0.1 localhost
Should there be another/different hosts file?

I also have (in the same location) a lmhosts.sam file which is empty - does this need a similar line?:
127.0.0.1 localhost

I can turn off Autodial & browse locally fine but how do I then connect to the Net when I need to browse? I get 'Page Cannot Be Displayed'.

Surely there must be a way to browse locally offline (localhost), and then when a Net connection is required click 'Connect' on the dial up prompt ... (?)

Thanks,
Andy

skipfactor

11:28 pm on Feb 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



'Start', 'Connections', right-click on your connection & drag it to the desktop creating a shortcut.

Or get broadband. ;)

AndyL

11:44 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



Thanks for the work around; it does work - just tested it.

Keep default connection property as Never Dial etc. but have a separate shortcut to force a connection when needing to connect to Net.

Strange solution but it works!

Am still curious as to why this isn't working how I'd expect it to though ...?!

skipfactor

11:54 pm on Feb 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Any remote elements in the site anywhere? Like a weather.com java banner or something?

You might try making a new dummy site with just 2 pages that link to each other & see if it trys to dial.

Tried surfing off of the machine's actual IP?

grahamstewart

9:21 am on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or upgrade to Windows XP.

Then you can leave it as 'Never Dial a Connection' and just go to Start->Connect To->*your isp* whenever you want to connect.

AndyL

10:43 am on Feb 12, 2004 (gmt 0)

10+ Year Member



There are remote elements in the site; yes!

As you suggested:
Tonight I'll try making a new dummy site with just 2 pages that link to each other (no remote elements) & see if it tries to dial up.

Thanks.

NB: I am using Win XP.

tomda

11:40 am on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I never had the problem with XP. But had it with W2000.

As you said, "Never dial" setup is a solution.

But the problem I had with the "Never dial" setup (on W2000) is that sometimes your browser will not refresh the page you have just modified and then you need to force it to refresh. Quite annoying!

For website banners, logos, and other stuff linked to WWW, I have a switch file (0 or 1) and type all my script with if ($switch=="value") statement so that it does not show the www elements in my localhost.

It is slighlty longer to script but the great thing about the switch is that it works fine both on localhost and online. You can even have different useful variables (such as $_SERVER['DOCUMENT_ROOT']; for example) for each switch.

Tommy

grahamstewart

3:28 pm on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am using XP

Then don't bother with creating a shortcut on the desktop (as skipfactor suggested) just use the existing Start Menu -> Connect To item instead.

(If you don't have this item then right click on the Start Menu, select Properties, then Customise.. Advanced.. and check the "Show Connect To" option)

skipfactor

3:50 pm on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>There are remote elements in the site; yes!

Well there's your deal; it's always going to try to dial unless you temporarily remove the remote elements or toggle "Never dial...".

g1smd

8:40 pm on Feb 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The .sam file is a sample, an example file. No need to change that one.