apache : RewriteRule problem

apache : RewriteRule problem

Post by peter pils » Mon, 24 Sep 2001 19:14:32



For a virtual Server on Apache 1.3.12 (extras : mod_perl, mod_rewrite) I
want virtually every access on this host have handled by a single script.
(access of virtual subfolders, files, scripts, pictures ... everything)

I thought this would be a simple rewriterule, but the following does not
work ... (404: file not found)

<VirtualHost 192.168.11.100>
    ServerName www2.local
    DocumentRoot /home/htdocs/www2/home

    Rewri*gine on
    RewriteRule !test\.pl /cgi-bin/test.pl

    Alias /cgi-bin /home/htdocs/www2/cgi-bin
   <Location /cgi-bin>
      AllowOverride None        
      Options None
      Order allow,deny
      Allow from all
      SetHandler perl-script
      PerlHandler Apache::Registry
      Options +ExecCGI
   </Location>
</VirtualHost>

I also tried to add the [T=application/x-httpd-cgi] with no success.
I also used absolute url as target  http://www.veryComputer.com/

The only file accessible is http://www.veryComputer.com/, so the first
part of the rule seems to work and I really dont know what can be wrong
with the second part ...

thnx,
peter

--
peter pilsl

http://www.veryComputer.com/

 
 
 

apache : RewriteRule problem

Post by Klaus Johannes Rusc » Tue, 25 Sep 2001 02:34:45



> For a virtual Server on Apache 1.3.12 (extras : mod_perl, mod_rewrite) I
> want virtually every access on this host have handled by a single script.
> (access of virtual subfolders, files, scripts, pictures ... everything)


--
Klaus Johannes Rusch

http://www.atmedia.net/KlausRusch/

 
 
 

1. Apache RewriteRule problem

Hi,

Ive got a problem with a rather simple RewriteRule.

URLs of the form

/-a96bfea988fb7fe5ea35a6c16ba38992171773e3f73306f5656t08271467nbmk-/testSID.
php?a=12345

should be rewritten to:

/testSID.php?a=12345&sessionID=a96bfea988fb7fe5ea35a6c16ba38992171773e3f7330
6f5656t08271467nbmk

URLs of the form

/-a96bfea988fb7fe5ea35a6c16ba38992171773e3f73306f5656t08271467nbmk-/testSID.
php

should be rewritten to:

/testSID.php?sessionID=a96bfea988fb7fe5ea35a6c16ba38992171773e3f73306f5656t0
8271467nbmk

The second RewriteRule works fine:
RewriteRule ^/-([0-9a-z]{64})-/(.*)$ /$2?sessionID=$1

However the first one doesnt work as expected:
RewriteRule ^/-([0-9a-z]{64})-/([^?]*)\?(.*)$ /$2?$3&sessionID=$1

The problem is the "([^?]*)\?(.*)" or rather the question mark between the
brackets. Apache doesnt mind if I escape the question mark or not. It
simply does NOT work.

If I use e.g. ([^?]*)_(.*) and the URL looks as follows:
/testSID.php_a=12345&sessionID=a96bfea988fb7fe5ea35a6c16ba38992171773e3f7330
6f5656t08271467nbmk
then everything works fine.

Looks as if I cannot escape the question mark?
Who can provide the correct RewriteRule for the first version containing a
question mark?

Another hint:
If I dont escape the question mark...
^/-([0-9a-z]{64})-/([^?]*)?(.*)$
...I get something like /testSID.php?&a=12345

So it seems that the last part of the string following the question mark is
not parsed at all...

Regards,
Sascha

2. missing libxil.so.1

3. RewriteRule duplicates $1 in RewriteRule

4. DHCPCD - LinuxPPC R5

5. Apache: Proxy Problem using ProxyPass or RewriteRule ... ... [P]

6. How do you get out FUNN/control characters

7. apache problem on RewriteCond / ReWriteRule

8. AHA 2940 Rev 7850 probs !?!

9. Apache RewriteRule Regular Expressions

10. Apache RewriteRule

11. HELP: Apache + Mod_rewite + login/authentication + proxypass + Rewriterule

12. Apache's mod_rewrite: [G] flag for RewriteRule

13. apache 1.3 and rewriterule and cookies