Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

slash after file does not cause error ... but creates problems

0 views
Skip to first unread message

Peter

unread,
Nov 16, 2009, 3:16:49 PM11/16/09
to
Hi,

Today I noticed that on my site, when I put a slash (/) behind a file name,
that the file is displayed properly,

e.g. www.mysite.com/help.php
results in the same as www.mysite.com/help.php/

A bit weird because the latter suggests a directory and I can assure you
that help.php is not a directory

This however causes a problem in my php, when building links, so that links
can be build such as:

www.mysite.com/help.php/support.php

And they WORK ??

I accidentally noticed this when I saw that Google had indexed such links.
In other words, somewhere a link with a backslash is used, and based on that
mistake other wrong links are in use (but seem to work, eventhough it's not
always the correct page then that is displayed).

I can try to patch this in my php so that such links cannot exist BUT I
think the essence is the fact that the filename with trailing slash is
simply accepted.
I don't think that should be the case ?

In fact, I can build rediculous links such as:
www.mysite.com/page.php/otherpage.php/newpage.php/newpageagain.php etc. etc.
and it will still work ...

My Q ....
HOW ?
I mean, where do I start looking for this strange behaviour ?
I can't seem to find anything in my .htaccess that can explain this
behaviour ?

--

Best Regards,
Peter


Peter

unread,
Nov 16, 2009, 3:29:15 PM11/16/09
to
Correction ... nothing is wrong with my php script, the links are relative,
so when the filename is seen as a directory, the relative links are build
from there ...
All is traceable back to the slash being accepted behind the filename

Peter

unread,
Nov 17, 2009, 9:15:09 AM11/17/09
to
Possibly not the best way to handle this issue, but what rewrite condition /
rule could I use to revert "filename.php/" to "filename.php" (without the
slash) ?

0 new messages