Forum Moderators: open
[servername...]
I have never had a problem using this format until now. I'm working with custom error files and need to use links that are relative to the ROOT of the site. Problem is that when I try to do that it thinks the root of the site is the root of the server. The links work on my live site at the webhost, just not with my local test server. Do I need to do something with virtual directories, host files, or something else? I saw some articles online that I thought might deal with this but they were confusing and contradicting each other.
[servername...]
I can't really help you here. If you're setting up server in a virtual directory, I can't think of anything server wise that will prevent the browser using the real root in absolute URLs.
Have you tried setting the BASE tag in your documents...
<base href="http://servername/websitename/">
If you set that at the top of each file, it may work.
The best solution I can offer is to stop using virtual directories.
Your development server should be set up with the exact same structure as your live server. if you fail to do this then you can expect problems like this to happen.
If your live site runs from the root eg. [servername...] then your development server should be set up to do the same.
What I would suggest doing for you is to create a new website on your local box.
Point the home directory for that website to C:\Inetpub\yourDomain.com\.
Put in a host header for that website called local.www.yourdomain.com where yourdomain is whatever your domain is.
In your C:\winnt\system32\drivers\etc\hosts file make the following entry:
127.0.0.1 local.www.yourdomain.com
Now, put the files for your website into the directory and you should be able to test with the same directory structure as you would have on your production website.
This website will only work from your box.
The great thing about this is that you can develop many sites on your local box without any conflict or reconfiguration when you need to switch to a different site.
Another idea is to have a subdomain called something like test.yourdomain.com which you protect with a challenge response password. This would be your test domain that you can upload and test on.
This is good for shared development environments.
-=casey=-
Windows 2000 Server is designed to run multiple web sites, but not Win 2000 Pro. I can however run a script that will allow me to create more websites using Win 2000 Pro, but I'm not "technically" supposed to do that and the sites won't be able to run concurrently. I found an article that tells how to do this for Win 2000 Pro and Win XP Pro by modifying the IIS metabase. I have not tried it yet, but it seems like what I should do.
I think what was confusing me is that there are so many websites that talk about hosting multiple websites in IIS, but many of them don't specify what versions of IIS and Windows they are even talking about. Thank you everyone for your responses, I got very useful information from all of them.
Use the hosts file to set up a local domain name for your public domain.
Use the script to create a local web site for your public web site.
Set the host header in IIS manager to match the local domain name in the hosts file.
(warning: there is a bug in windows XP SP2 using hosts files [google.com] with the frontpage server extensions)
A simpler, but not as elegant solution is to set up multiple sites using differnt webroots eg...
d:\mysites\www.site1.com\webroot\
d:\mysites\www.site2.com\webroot\
d:\mysites\www.site3.com\webroot\
Then when you want to switch development to another site, just change the home directory in the IIS console.