Apache Server configuration support - cgi and mod_rewrite

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > January 2007 > cgi and mod_rewrite





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author cgi and mod_rewrite
cpayne.tcr@gmail.com

2007-01-10, 1:19 pm

Is there a way to use mod_rewrite to
- test incoming uri for something like /cgi-bin/foo/bar.cgi
- and then remap it to a file like so foo/bar.php

I have tried this:
RewriteRule ^/cgi-bin/foo/bar\.cgi$ foo/bar.php [R,L,QSA]
but my rewrite log show this:
- (2) init rewrite engine with requested uri /cgi-bin/foo/bar.cgi
- (3) applying pattern '.*' to uri '/cgi-bin/foo/bar.cgi'
- (4) RewriteCond: input='GET' pattern='^TRACE' => not-matched
- (1) pass through /cgi-bin/foo/bar.cgi

Any thoughts?

cpayne.tcr

2007-01-10, 7:31 pm

Come on folks, this is killing me...

cpayne.tcr@gmail.com wrote:
> Is there a way to use mod_rewrite to
> - test incoming uri for something like /cgi-bin/foo/bar.cgi
> - and then remap it to a file like so foo/bar.php
>
> I have tried this:
> RewriteRule ^/cgi-bin/foo/bar\.cgi$ foo/bar.php [R,L,QSA]
> but my rewrite log show this:
> - (2) init rewrite engine with requested uri /cgi-bin/foo/bar.cgi
> - (3) applying pattern '.*' to uri '/cgi-bin/foo/bar.cgi'
> - (4) RewriteCond: input='GET' pattern='^TRACE' => not-matched
> - (1) pass through /cgi-bin/foo/bar.cgi
>
> Any thoughts?


Jim Hayter

2007-01-10, 7:31 pm

cpayne.tcr wrote:
> Come on folks, this is killing me...
>
> cpayne.tcr@gmail.com wrote:
>


You show us a rewrite rule but your log file also shows a rewrite cond.
What is the totality of the rewrite directives being applied here?

It almost looks like there is an earlier set of rewrite directives
consisting of:
RewriteCond <is this NOT a TRACE request>
RewriteRule .* passthru anything that matches condition

The passthru will bypass any further rewrite rule processing.

Jim
cpayne.tcr

2007-01-10, 7:31 pm

Jim,

Thank you for your reply.

I think I neglected to indicate that this is in an htaccess file in the
document root of my webserver.

There are two other conditions in this particular htaccess file: it
tests against the request NOT being an actual file or directory and
rewrites the base by adding a slash before the rewrite rule I wrote
below.

Is there somewhere else that a condition could be invoked that is
highjacking the process?

Thanks,

Charles

Jim Hayter wrote:
> cpayne.tcr wrote:
>
> You show us a rewrite rule but your log file also shows a rewrite cond.
> What is the totality of the rewrite directives being applied here?
>
> It almost looks like there is an earlier set of rewrite directives
> consisting of:
> RewriteCond <is this NOT a TRACE request>
> RewriteRule .* passthru anything that matches condition
>
> The passthru will bypass any further rewrite rule processing.
>
> Jim


Jim Hayter

2007-01-11, 1:32 pm

cpayne.tcr wrote:
> Jim,
>
> Thank you for your reply.
>
> I think I neglected to indicate that this is in an htaccess file in the
> document root of my webserver.
>
> There are two other conditions in this particular htaccess file: it
> tests against the request NOT being an actual file or directory and
> rewrites the base by adding a slash before the rewrite rule I wrote
> below.
>
> Is there somewhere else that a condition could be invoked that is
> highjacking the process?
>


I don't use .htaccess as I control my httpd.conf files. Is it possible
that there are Rewrite conditions/rules in the main configuration file
that are interfering with what you want to do?

Do any of your existing rewrite rules set the L or PT flags?

Jim
cpayne.tcr

2007-01-11, 7:33 pm



On Jan 11, 9:37 am, Jim Hayter <see.reply...@nowhere.invalid> wrote:
> cpayne.tcr wrote:
>
>
>
>
> that there are Rewrite conditions/rules in the main configuration file
> that are interfering with what you want to do?
>
> Do any of your existing rewrite rules set the L or PT flags?
>
> Jim


I think you are correct. I'm not sure how much control I will have
over the new server (I've been working on my local machine) so I will
look into controlling it through the .conf file.

Thanks again.

Charles

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com