Re: Problem with URL Rewriting

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

 



On 05/30/2012 08:39 AM, Jean-Christophe Boggio wrote:
Hello, I have a problem with URL Rewriting.

I'm trying to transform URLs of the form :

http://medecine-et-enfance.net/archives/voir.html?file=J_2005_01_039.pdf
to
http://medecine-et-enfance.net/showpdf.html?file=J_2005_01_039.pdf

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 :
http://medecine-et-enfance.net/data/pdf/J_2005_01_039.pdf

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

To clarify, are you looking to have the URL in the browser change? If so, change the [L] in the RewriteRule lines to [LR].

http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_r


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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux