Virtual Hosting: Browsers and PAC
Virtual Hosting: Home | Name based | PAC | Browsers and PAC | Making it portable | Issues |
Browsers and PAC |
Installing the PAC file is easy I use both Firefox and Opera always dread firing up IE6 for testing; can almost guarantee to hit some problem. To my surprise it worked although I always get confused when to use a forward or backward slash.
Interestingly you will notice Firefox requires three forward slashes after “file” although technically correct again confusing. Well I am easily confused hence the images, if I have not covered your browser at least these three will give you some idea where to look.
I located my PAC file (test.pac) at the top level on G drive (makes for less typing) if you choose to bury it in sub-folders enjoy the typing. Note, the file can be located anywhere you like.
Firefox 2.x.x.x 3.0
I am biased when it comes to browsers and they are listed in order of preference Firefox is my personal favorite.
Note: Item 6 use this to enable or disable the file as and when required. |
Alternative method: Firefox has another method of doing things perhaps you may prefer this alternative:
|
Opera 9.10
Note 2: Make sure you enter file with two forward slashes file://G:/test.pac |
IE 6
Note 2: Make sure you use back slashes for the rest of the file name. |
Testing
If it not already running start Uniform Server and type into your browser address bar the site names you setup on the previous page (reproduced below):
Addresses |
---|
|
Test your links (relative, root relative and absolute) if you are working on sites that are cross-linked these will also work.
Summary
With just a few lines of code you can simulate a DNS server allowing you to be that little more confident your sites will work when published.
This write-up was inspired by dimo414 for asking such awkward questions over on the forum. I have always used the local hosts file to implement this type of solution. However when replying to dimo414 it triggered the idea of a fully portable testing server including browser see next page for this solution.
Ric |