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.
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.
If
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
posted by tomwheeler at 3:11 PM on June 17, 2008
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
Response by poster: 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
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
This thread is closed to new comments.
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