Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6183181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:19:18+00:00 2026-05-24T01:19:18+00:00

UPDATE 1: I have now setup IIS6 so .NET can handle calls to .css

  • 0

UPDATE 1:

I have now setup IIS6 so .NET can handle calls to .css files. What do I have to do now to get it to change css files based on the referal url? So if the referal url is http://intranet/, it should continue calling the old style sheets. If the referal url is http://intranetv2/, it should call the new style sheet.


ORIGINAL QUESTION:

The background:

I have 2 search engines. 1 is old and the other is brand new (development stage). Search engine 1 is on domain1.com and search engine 2 is on domain2.com. Both domains are on the same server. Both search for webpages on domain1.com based on what the user enters into the search engines. The difference between the 2 search engines is that the new one is faster, produces more accurate results, and has a hugely improved user interface. Both search engines will remain live just so the users can get used to the new one in their own time, instead of just throwing them into the deep end and removing the old search engine altogether.

Anyway, enough of the background, basically, as the searchable pages reside on the old domain name with the old search engine, whereas the new search engine is on the new domain name, …

The question:

… can I use HttpModule, or another part of .NET, or something from IIS6 even to capture the page links generated by the new search engine, and dynamically change the css file attached to the old searchable pages on the old domain?

The reason:

In effect making it look like a full brand new site, where if the search engine on the old domain is used to access the pages on the old domain, the old stylesheet is used, but if the search engine on the new domain is used to access the searchable files on the old domain name, a new stylesheet should be used to make the old pages look new. As there are lots of searchable pages, in the region of 10,000, editing each and every page to add an if statement to check the referral domain name before adding a style sheet to the pages is not a realistic option.

The environment:

The old search engine, along with the searchable pages on the old domain use .net 1.something, but the new search engine on the new domain name is using .net 3.5, and I am using vb.net for the asp.net pages. The server is a IIS6 server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:19:19+00:00Added an answer on May 24, 2026 at 1:19 am
    1. In IIS, Setup the HttpHandler to receive all the file types you want (says you have done this)
    2. user Server.MapPath() on HttpRequest.Url.AbsolutePath to get the physical path
    3. Modify the path according to the domain
    4. Write the file to the response stream.

    Here is a handler (simplified) that I use routinely to server alternate files for different domains:

    using System;
    using System.IO;
    using System.Web;
    public class MultiDomainFileHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            string filePath = GetDomainSpecificFilePath(context.Request.Url.Host,
                context.Server.MapPath(context.Request.Url.AbsolutePath));
    
            if (File.Exists(filePath))
            {
                switch (Path.GetExtension(filePath).ToLower())
                {
                    case ".css": context.Response.ContentType = "text/css"; break;
                    case ".jpg":
                    case ".jpeg": context.Response.ContentType = "image/jpeg"; break;
                    //other types you want to handle
                    default: context.Request.ContentType = "application/octet-stream"; break;
                }
                context.Response.WriteFile(filePath); //Write the file to response
            }
            else context.Response.StatusCode = 404;
        }
    
        private string GetDomainSpecificFilePath(string domain, string originalPath)
        {
            string prefix = "";
            switch (domain.ToLower())
            {
                case "intranetv2": prefix = FILE_PREFIX_INTRANETV2; break;
                case "www.example.com": prefix = FILE_PREFIX_EXAMPLE_DOT_COM; break;
                //other domains you want to handle
            }
            string dir = Path.GetDirectoryName(originalPath);
            string fileName = prefix + Path.GetFileName(originalPath);
            return Path.Combine(dir, fileName);
        }
    
        const string FILE_PREFIX_INTRANETV2 = "v2.", FILE_PREFIX_EXAMPLE_DOT_COM = "ex.com.";
        public bool IsReusable { get { return false; } }
    }
    

    Now, you simple need to have alternate files in the same directories. E.g:

    /Images/logo.jpg

    /Images/v2.logo.jpg

    /Styles/mystyle.css

    /Styles/v2.mystyle.css

    I hope this helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have been using Leopard for a year now, and the lastest update
Currently, I am using an with ajax to update my mysql. Now, I have
I have made a setup and deployment project in C#, Now i have another
I have an automatic update system that replaces my existing program files on reboot.
I have a Setup Project and now i'm at the point where i wonder
I have a custom taxonomy setup called albums, and a new album can be
Hello there I have an updatepanel setup. I have set its update mode to
I have to implement client server based app where client is windows app. Now,
I have a working setup, where all files are in the same directory (Desktop).
Update: Microsoft have now reproduced the bug and are working on a fix. Whilst

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.