Problem with URL Rewriting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hello, I have a problem with URL Rewriting.

I'm trying to transform URLs of the form :

I have defined the following in the VirtualHost :

        RewriteEngine   on

        RewriteLog      "/tmp/ecm3-rewrite.log"
        RewriteLogLevel 4

        RewriteCond     %{QUERY_STRING}                                 file=(.*)
        RewriteRule     ^/archives/voir.html                            /showpdf.html?file=%1 [L]

        RewriteRule     (^/data/pdf/.*)                                 /showpdf.html?file=$1 [L]

This last line is to address a different case where users could get the files directly
by requesting :

Everything seems fine, if I look at the logs : - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (2) init rewrite engine with requested uri /archives/voir.html - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (3) applying pattern '^/archives/voir.html' to uri '/archives/voir.html' - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (4) RewriteCond: input='file=/data/pdf/J_2005_01_039.pdf' pattern='file=(.*)' => matched - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (2) rewrite '/archives/voir.html' -> '/showpdf.html?file=/data/pdf/J_2005_01_039.pdf' - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (3) split uri=/showpdf.html?file=/data/pdf/J_2005_01_039.pdf -> uri=/showpdf.html, args=file=/data/pdf/J_2005_01_039.pdf - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (2) local path result: /showpdf.html - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (2) prefixed with document_root to /var/www/sites/ecm3/showpdf.html - - [30/May/2012:14:48:51 +0200] [][rid#7fd43f2f80a0/initial] (1) go-ahead with /var/www/sites/ecm3/showpdf.html [OK]

But I have put a spy in /archives/voir.html to see if the page is still being called, and it is :

==> /var/log/apache2/ecm/error.log <==
[Wed May 30 14:48:51 2012] [warn] [27627]ERR:  32:  Warning in Perl code: Acces a voir.html non filtre ! at //var/www/sites/ecm3/archives/voir.html line 20, <GEN0> line 4.
[Wed May 30 14:48:51 2012] [warn] [27627]ERR:  32:  Warning in Perl code: showpdf: /data/pdf/J_2005_01_039.pdf at /var/www/sites/ecm3/showpdf.html line 25, <GEN0> line 4.

The users still can get the files using voir.html (though showpdf.html seems to be called ?!)

Thanks for your help,


To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

[Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

Add to Google Powered by Linux