Re: Disallow path info

Phillip Hellewell <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CA+dWQFqy=y30gckvYQT2pzmCLda-re94K=yQNzYW-D5YQ8SmVg@mail.gmail.com>
On Tue, Mar 24, 2015 at 9:29 AM, Szekeres Jr., Edward
<[email protected]> wrote:
> I am not sure why something as simple as this would be considered  "dicing and slicing", simply blocks any requests with "path[any character]info" in them
>
>     RewriteEngine On
>     RewriteCond %{REQUEST_URI} ^.*(path.info).* [NC]
>     RewriteRule ^(.*)$ - [F]

The /path/info was just an example.  I need to return 404 when any
extra stuff is after the script, even just a single slash, e.g.

http://mysite.example.com/myscript.pl/path/info.
http://mysite.example.com/myscript.pl/junk
http://mysite.example.com/myscript.pl/hello/there
http://mysite.example.com/myscript.pl/wrong.jpeg
http://mysite.example.com/myscript.pl/

All of those should return 404 (and now they do with the fix I have in place).

Phillip
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.