Loading ...
Sorry, an error occurred while loading the content.

Config question

Expand Messages
  • Fagyal, Csongor
    Hi, I would like to map all incoming requests of a virtualhost to the same ASP file. Is there a way I can do this without using mod_rewrite? So I need
    Message 1 of 6 , Oct 13, 2003
    • 0 Attachment
      Hi,

      I would like to map all incoming requests of a virtualhost to the same
      ASP file. Is there a way I can do this without using mod_rewrite?
      So I need
      http://domain/whatever/andanythingelse
      http://domain/whatever/hello.xyz?zoh=zoh
      call the same
      $documentroot/index.asp
      which should be able to access the URI (in the original form).

      Is this possible? How?

      Thanx,
      - Csongor



      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Peter Galbavy
      ... In my config, I map a specific pattern through to an ASP, but you could just match anything: httpd.conf: PerlTransHandler Some::Redirect; startup.pl: ...
      Message 2 of 6 , Oct 13, 2003
      • 0 Attachment
        Fagyal, Csongor wrote:
        > I would like to map all incoming requests of a virtualhost to the same
        > ASP file. Is there a way I can do this without using mod_rewrite?
        > So I need
        > http://domain/whatever/andanythingelse
        > http://domain/whatever/hello.xyz?zoh=zoh
        > call the same
        > $documentroot/index.asp
        > which should be able to access the URI (in the original form).
        >
        > Is this possible? How?

        In my config, I map a specific pattern through to an ASP, but you could just
        match anything:

        httpd.conf:

        PerlTransHandler Some::Redirect;

        startup.pl:

        ...
        package Some::Redirect;

        use Apache::Constants qw(:common);

        sub handler
        {
        my $r = shift;

        # match 16 hex digits (hand edited for e-mail example)
        if ($r->is_initial_req && $r->uri =~ m|^/([\da-f]{16})?$|) {
        if ($r->args) {
        $r->args($r->args . "&ref=$1");
        } else {
        $r->args("ref=$1");
        }
        $r->uri("/something.asp");
        }

        return DECLINED;
        }


        Peter


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Fagyal, Csongor
        Thank you, Peter, it looks like this is exactly what I need! - Csongor ... To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org For additional commands,
        Message 3 of 6 , Oct 13, 2003
        • 0 Attachment
          Thank you, Peter, it looks like this is exactly what I need!

          - Csongor

          >Fagyal, Csongor wrote:
          >
          >
          >>I would like to map all incoming requests of a virtualhost to the same
          >>ASP file. Is there a way I can do this without using mod_rewrite?
          >>So I need
          >>http://domain/whatever/andanythingelse
          >>http://domain/whatever/hello.xyz?zoh=zoh
          >>call the same
          >>$documentroot/index.asp
          >>which should be able to access the URI (in the original form).
          >>
          >>Is this possible? How?
          >>
          >>
          >
          >In my config, I map a specific pattern through to an ASP, but you could just
          >match anything:
          >
          >httpd.conf:
          >
          >PerlTransHandler Some::Redirect;
          >
          >startup.pl:
          >
          >...
          >package Some::Redirect;
          >
          >use Apache::Constants qw(:common);
          >
          >sub handler
          >{
          > my $r = shift;
          >
          > # match 16 hex digits (hand edited for e-mail example)
          > if ($r->is_initial_req && $r->uri =~ m|^/([\da-f]{16})?$|) {
          > if ($r->args) {
          > $r->args($r->args . "&ref=$1");
          > } else {
          > $r->args("ref=$1");
          > }
          > $r->uri("/something.asp");
          > }
          >
          > return DECLINED;
          >}
          >
          >
          >Peter
          >
          >



          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        • Quentin Smith
          ... Hi- I ll assume that you re running on Apache. This is ridiculously easy with Apache s mod_rewrite. Basically, you just turn rewrite on and direct every
          Message 4 of 6 , Oct 13, 2003
          • 0 Attachment
            On Mon, 13 Oct 2003, Fagyal, Csongor wrote:

            > Date: Mon, 13 Oct 2003 14:17:06 +0200
            > From: "Fagyal, Csongor" <concept@...>
            > To: "'asp@...'" <asp@...>
            > Subject: Config question
            >
            > Hi,
            >
            > I would like to map all incoming requests of a virtualhost to the same
            > ASP file. Is there a way I can do this without using mod_rewrite?
            > So I need
            > http://domain/whatever/andanythingelse
            > http://domain/whatever/hello.xyz?zoh=zoh
            > call the same
            > $documentroot/index.asp
            > which should be able to access the URI (in the original form).
            >
            > Is this possible? How?

            Hi-
            I'll assume that you're running on Apache. This is ridiculously easy with
            Apache's mod_rewrite. Basically, you just turn rewrite on and direct every
            request to your script. Put lines like this in the appropriate section of
            your httpd.conf (a Location or VirtualHost, perhaps):

            RewriteEngine On
            RewriteRule ^/(.*) /index.asp/$

            If you're on Apache 2, you might also need:

            AcceptPathInfo On

            Then you can access the incoming path as PATH_INFO in
            $Request->ServerVariables("PATH_INFO").
            HTH,
            --Quentin

            >
            > Thanx,
            > - Csongor


            ---------------------------------------------------------------------
            To unsubscribe, e-mail: asp-unsubscribe@...
            For additional commands, e-mail: asp-help@...
          • Fagyal, Csongor
            Quentin, ... Well, it would be, but I want to do it without using mod_rewrite. First, mod_rewrite is not available on the target server :-) Second, I also want
            Message 5 of 6 , Oct 13, 2003
            • 0 Attachment
              Quentin,

              >Hi-
              >I'll assume that you're running on Apache. This is ridiculously easy with
              >Apache's mod_rewrite.
              >
              Well, it would be, but I want to do it without using mod_rewrite. First,
              mod_rewrite is not available on the target server :-) Second, I also
              want to do some other magic (for example authentication) - so Peter's
              version is more suitable for what I need. But thanx!

              - Csongor


              ---------------------------------------------------------------------
              To unsubscribe, e-mail: asp-unsubscribe@...
              For additional commands, e-mail: asp-help@...
            • Quentin Smith
              ... Ooops. Didn t see that clause in your question :) Sorry, --Quentin ... To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org For additional commands,
              Message 6 of 6 , Oct 13, 2003
              • 0 Attachment
                On Mon, 13 Oct 2003, Fagyal, Csongor wrote:

                > Date: Mon, 13 Oct 2003 16:21:55 +0200
                > From: "Fagyal, Csongor" <concept@...>
                > To: Quentin Smith <quentins.l@...>
                > Cc: asp@...
                > Subject: Re: Config question
                >
                > Quentin,
                >
                > >Hi-
                > >I'll assume that you're running on Apache. This is ridiculously easy with
                > >Apache's mod_rewrite.
                > >
                > Well, it would be, but I want to do it without using mod_rewrite. First,
                > mod_rewrite is not available on the target server :-) Second, I also
                > want to do some other magic (for example authentication) - so Peter's
                > version is more suitable for what I need. But thanx!

                Ooops. Didn't see that clause in your question :)
                Sorry,
                --Quentin

                >
                > - Csongor


                ---------------------------------------------------------------------
                To unsubscribe, e-mail: asp-unsubscribe@...
                For additional commands, e-mail: asp-help@...
              Your message has been successfully submitted and would be delivered to recipients shortly.