Redirecting a directory to a TLD?
June 17, 2008 2:35 PM   Subscribe

Having problems with a TLD that lives as a subdirectory.

I have recently become responsible for maintaining an organization's website. I'm not a web guru by any means, this is just a small part of my duties.

We are part of a larger organization that is currently hosting our site on their server. (http://www.example.com) Our site is a subdirectory (foo/)... We have our own tld (foobar.com), but Google is currently only indexing us as www.example.com/foo. Is there a way we can have anybody who accesses us at example.com/foo be redirected so they are viewing us as foobar.com? The webserver is IIS 2003.
posted by entropicamericana to Computers & Internet (3 answers total)
 
I think you mean you have your own domain name. .com is the TLD.

There are several ways to create a redirect from example.com/foo to foobar.com. Here's a pretty comprehensive description of ways to redirect a domain name to a subdirectory with IIS. You'll need to answer some questions for yourself about the functionality you want the redirect to have and the author lays them out pretty well.
posted by chesty_a_arthur at 2:58 PM on June 17, 2008


If http://www.example.com/foo/ and http://www.example.com/ do not point to the same place, then you should be able to simply set up a redirect in IIS. It has been many years since I used IIS, but I recall that it was fairly intuitive to do this through the administration panel.

If they do point to the same place, then you'd likely wind up in an endless cycle of redirects by doing that. In this case, the easiest thing might be to add some code to the default document in your foo subdirectory (it's typically named default.asp) that will examine the requested URL and send an HTTP 301 (permanent redirect) code to the browser along with the new URL of http://www.example.com/.
posted by tomwheeler at 3:11 PM on June 17, 2008


Oops. I misspoke about the TLD.

Tom: The way it is set up is that example.com is hosting our website foo.com on their server at directory foo. So the content that lives at foo can be viewed by accessing example.com/foo or at foo.com. Right now our default page is index.htm... It sounds like I would be setting up an endless cycle of redirects, correct?
posted by entropicamericana at 3:23 PM on June 17, 2008


« Older Looking for more foodies.   |   Where to get bracelet making instructions (with a... Newer »
This thread is closed to new comments.