SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member ScepterMT's Avatar
    Join Date
    Feb 2008
    Location
    Leesville, LA
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using HTTPModule to rewrite subdomains?

    Can anyone explain to me how to use the HTTPModule to rewrite my urls to support a sort of dynamic subdomains.

    I'm trying to convert:
    http://sceptermt.sceptermarketingtechnologies.com/

    into:
    http://www.sceptermarketingtechnologies.com/default.aspx?user=sceptermt.

    Is there a way to do this without having to use a host that supports the (*) wildcard character for dns?

    Any pointers would be very helpful.

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Using the http module to rewrite the urls is pretty straightforward. Your bigger problem is getting the requests into the ASP.NET runtime (unless you are on Windows Server 2008).

    I don't think you can get around the wildcard issue--the requests need to get pointed to your server somehow, and, if you want to use arbitrary host names, you need a wildcard dns for things to go.

    Once you are there, you will probably need to use a wildcard mapping within your application to force all requests to go into asp.net.

    An easier approach would be to rewrite urls using folders--www.example.com/foo becoming www.example.com/default.aspx?user=foo.

  3. #3
    SitePoint Evangelist
    Join Date
    Aug 2004
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a solution i'm using

    for www.mixhacks.com

    i'm doing exactly that.

    i setup apache to mod_rewrite and proxy to an iis site.
    I also used
    PHP Code:
          <tagMapping>
            <
    add tagType="System.Web.UI.HtmlControls.HtmlForm"
                 
    mappedTagType="RobustHaven.Domains.Web.Controls.Form"/> 
    to rewrite the action="" of the form element to nothing.. the browser then postbacks to the same url as in the browser which apache interprets to the same url for iis.. so that the postback mechanism works.


    luckly my setup was easy as i have open suse as my base with windows 2003 server running inside vmware.

    -lm


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •