Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Funnel all requests through one file ???

Status
Not open for further replies.

elhaix

Programmer
Jul 31, 2006
115
CA
Using Helicon's ISAPI Rewrite tool I want to filter all *.prod.myhost.com requests to propertyalpha1.prod.myhost.com.

The next rule set I want is to translate (*.)\.(*.)\.(*.) to the wame url, grabbing parameters. So to begin with, the subdomain issue:


Using the RegExp Test Utility, I created the following expression which gives me what I need, however I'm unable to apply it as a rewrite rule:

Given this URL: propertyalpha2.prod.myhost.com/default.aspx?p1=333&p2=4444

And this regexp:

Code:
^((.*)\.prod\.myhost\.com)/?(.*\..*)\?(.*)$


Returns:
$1: propertyalpha2.prod.myhost.com
$2: propertyalpha2
$3: default.aspx
$4: p1=333&p2=4444

So this should be formatted as:

Code:
[URL unfurl="true"]http://propertyalpha1.prod.myhost.com/default.aspx?siteID=$1&filename=$3&parameters=$4[/URL]

In C# I've got the following to return the results

Code:
        siteid1 = Request.QueryString["siteid"];
        filename1 = Request.QueryString["filename"];
        parameters1 = Request.QueryString["parameters"];

        Response.Write ("<br><b>siteid:</b> " + siteid1 + "<br><b>filename:</b> " + filename1 + "<br>");

        Response.Write("<br><br>Original URL: " + Request.ServerVariables["HTTP_X_REWRITE_URL"] + "<br><br>");

So technically it should work, but not getting the right config in Helicon's httpd.ini.

Of course this isn't the only way to accomplish what I'm trying to do, so any other suggestions or assistance would be appreciated.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top