PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > mod_rewrite and Apache 2.2
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

mod_rewrite and Apache 2.2

Réponse
 
LinkBack Outils de la discussion
Vieux 09/02/2007, 06h17   #1
Omri Schwarz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut mod_rewrite and Apache 2.2

Hi, all.

I've a couple Rewrite rules for my site (an Insurrection/Subversion site)
and they work just fine when I add [R] for a redirect, except
I really would rather not do that.

And when I leave off the redirect, my verbose
rewrite log shows that the rule does get carried out,
but then passed through, and thus turned into a no-op.
What do I do to avert that?

Here's the rule:

RewriteCond %{REQUEST_METHOD} "^(GET|POST)$"
RewriteCond %{QUERY_STRING} "^$"
RewriteRule ^/nvs(/.*/)$ "/Insurrection/ls.cgi?Insurrection=ls&HTTPS=%{HTTPS}&Rewritten=ye s&Path=$1" [NE,L]

Works as specified when I add an R to the flags, but fails with this in the
logs when I neglect to:

66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) init rewrite engine with requested uri /nvs/faq/
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) applying pattern '^/nvs(/.*)$' to uri '/nvs/faq/'
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='GET' pattern='^(GET|POST)$' => matched
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='' pattern='Insurrection=(admin|atom|bandwidth|blame| diff|dump|get|log|ls|rss|savelog|uploaddir|upload) ' => not-matched
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) applying pattern '^/nvs(/.*/)$' to uri '/nvs/faq/'
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='GET' pattern='^(GET|POST)$' => matched
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='' pattern='^r([0-9]+)$' => not-matched
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) applying pattern '^/nvs(/.*/)$' to uri '/nvs/faq/'
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='GET' pattern='^(GET|POST)$' => matched
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='' pattern='^$' => matched
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) rewrite '/nvs/faq/' -> '/Insurrection/ls.cgi?Insurrection=ls&HTTPS=on&Rewritten=yes&Path =/faq/'
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) split uri=/Insurrection/ls.cgi?Insurrection=ls&HTTPS=on&Rewritten=yes&Path =/faq/ -> uri=/Insurrection/ls.cgi, args=Insurrection=ls&HTTPS=on&Rewritten=yes&Path=/faq/
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) local path result: /Insurrection/ls.cgi
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) prefixed with document_root to /var/www/html/Insurrection/ls.cgi
66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (1) go-ahead with /var/www/html/Insurrection/ls.cgi [OK]
66.35.250.151 - omri [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (1) [perdir /var/www/html/Insurrection/] pass through /var/www/html/Insurrection/ls.cgi

Note the last two lines? What gives? Everything is fine, and
then there's a pass through.
--
Omri Schwarz --- ocschwar@mit.edu
Timeless wisdom of biomedical engineering: "Noise is principally
due to the presence of the patient." -- R.F. Farr

  Réponse avec citation
Vieux 09/02/2007, 10h59   #2
shimmyshack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mod_rewrite and Apache 2.2

On 9 Feb, 06:17, Omri Schwarz <ocsc...@h-after-ocsc.mit.edu> wrote:
> Hi, all.
>
> I've a couple Rewrite rules for my site (an Insurrection/Subversion site)
> and they work just fine when I add [R] for a redirect, except
> I really would rather not do that.
>
> And when I leave off the redirect, my verbose
> rewrite log shows that the rule does get carried out,
> but then passed through, and thus turned into a no-op.
> What do I do to avert that?
>
> Here's the rule:
>
> RewriteCond %{REQUEST_METHOD} "^(GET|POST)$"
> RewriteCond %{QUERY_STRING} "^$"
> RewriteRule ^/nvs(/.*/)$ "/Insurrection/ls.cgi?Insurrection=ls&HTTPS=%{HTTPS}&Rewritten=ye s&Path=$1" [QSA,NE,L]
>
> Works as specified when I add an R to the flags, but fails with this in the
> logs when I neglect to:
>
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) init rewrite engine with requested uri /nvs/faq/
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) applying pattern '^/nvs(/.*)$' to uri '/nvs/faq/'
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='GET' pattern='^(GET|POST)$' => matched
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='' pattern='Insurrection=(admin|atom|bandwidth|blame| diff|dump|get|log|ls|rss|savelog|uploaddir|upload) ' => not-matched
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) applying pattern '^/nvs(/.*/)$' to uri '/nvs/faq/'
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='GET' pattern='^(GET|POST)$' => matched
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='' pattern='^r([0-9]+)$' => not-matched
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) applying pattern '^/nvs(/.*/)$' to uri '/nvs/faq/'
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='GET' pattern='^(GET|POST)$' => matched
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (4) RewriteCond: input='' pattern='^$' => matched
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) rewrite '/nvs/faq/' -> '/Insurrection/ls.cgi?Insurrection=ls&HTTPS=on&Rewritten=yes&Path =/faq/'
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (3) split uri=/Insurrection/ls.cgi?Insurrection=ls&HTTPS=on&Rewritten=yes&Path =/faq/ -> uri=/Insurrection/ls.cgi, args=Insurrection=ls&HTTPS=on&Rewritten=yes&Path=/faq/
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) local path result: /Insurrection/ls.cgi
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (2) prefixed with document_root to /var/www/html/Insurrection/ls.cgi
> 66.35.250.151 - - [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (1) go-ahead with /var/www/html/Insurrection/ls.cgi [OK]
> 66.35.250.151 - omri [09/Feb/2007:00:53:22 --0500] [server.mit.edu/sid#88fcdb8][rid#a34ff78/initial] (1) [perdir /var/www/html/Insurrection/] pass through /var/www/html/Insurrection/ls.cgi
>
> Note the last two lines? What gives? Everything is fine, and
> then there's a pass through.
> --
> Omri Schwarz --- ocsch...@mit.edu
> Timeless wisdom of biomedical engineering: "Noise is principally
> due to the presence of the patient." -- R.F. Farr


Query String Append?
[QSA,NE,L]

  Réponse avec citation
Vieux 09/02/2007, 23h46   #3
Omri Schwarz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mod_rewrite and Apache 2.2

"shimmyshack" <matt.farey@gmail.com> writes:

> On 9 Feb, 06:17, Omri Schwarz <ocsc...@h-after-ocsc.mit.edu> wrote:
> > Hi, all.
> >
> > I've a couple Rewrite rules for my site (an Insurrection/Subversion site)
> > and they work just fine when I add [R] for a redirect, except
> > I really would rather not do that.
> >
> > And when I leave off the redirect, my verbose
> > rewrite log shows that the rule does get carried out,
> > but then passed through, and thus turned into a no-op.
> > What do I do to avert that?
> >
> > Here's the rule:
> >
> > RewriteCond %{REQUEST_METHOD} "^(GET|POST)$"
> > RewriteCond %{QUERY_STRING} "^$"
> > RewriteRule ^/nvs(/.*/)$ "/Insurrection/ls.cgi?Insurrection=ls&HTTPS=%{HTTPS}&Rewritten=ye s&Path=$1" [QSA,NE,L]
> >

[...]
>
> Query String Append?
> [QSA,NE,L]
>


Close. PT wound up doing the trick.

Thanks, though!

--
Omri Schwarz --- ocschwar@mit.edu
Timeless wisdom of biomedical engineering: "Noise is principally
due to the presence of the patient." -- R.F. Farr
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h28.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15934 seconds with 11 queries