Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have an internal website and virtual directory http://server2012/logs. I created a CNAME on my DNS server as LOGS -> server2012. I would like to set it up so that http://LOGS redirects to http://server2012/logs. Ideally, I would still want it so that all pages appear in the browser as being off from the LOGS URL. So http://LOGS/network.html?site=32 is what is displayed in the browser, but it is really being served from http://server2012/logs/network.html?site=32. I've looked at URL rewrite, but can't seem to get to work.

share|improve this question
    
You visit the site, yet no comment to my answer? –  Patrik Alienus Jan 28 '13 at 20:37
add comment

2 Answers

I believe you can do this easily enough in IIS 7.x:

  1. Create the DNS alias/CNAME pointing logs to server2012 --> You've already done this.

  2. Create a new site on the server2012 that responds to the host header logs (or, better yet, the FQDN like logs.domain.tld)

  3. Now you have two options:

    a. Use IIS 7's basic redirection feature to direct the URLS to http://server2012/logs/... --> This will change the URL the user sees, not mask it like you were hoping.

    b. Use the more advanced URL Rewrite module to mask the redirect/rewrite so it still looks like you're browsing http://logs/...

Good luck!

share|improve this answer
add comment

I'm not sure this is at all possible. The LOGS need to be its own virtual server.

So essentially, set up a new virtual web server (if you're using Apache this is a breeze,) with it's root folder pointing to the same folder as this one does: in http://server2012/logs/.

Then, set up your DNS (bind?) to aim the internal traffic from http://LOGS/ to the physical server.

To tie it all up, simply make the new virtual web server respond to only http://LOGS/, and the http://server2012 web server, only respond to that.

I run this type of set up at my home office for developing client sites, and it's been running 20 or more sites at once for years without headaches.

Bare in mind, the /logs/ folder will still be accessible through http://server2012/logs/. If this is unwanted, you can probably fix that with the .htaccess file.

Edit: If it weren't clear already, this is obviously not a CNAME fix - you might as well us an A record. :)

Hopefully that helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.