Web Servers on Unix and Linux - Problem http://url/index.php/ (extra slash)

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > February 2005 > Problem http://url/index.php/ (extra slash)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problem http://url/index.php/ (extra slash)
BiggeR

2005-02-20, 8:47 pm

Hello,

i have a problem with my php/apache server.

if a user goes to the URL http://url/index.php/ (extra slash) he will
NOT get an error but a page without any image

how can i return a 404 error ?

i tested

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*) $1

but doesn't work :-(
Marc Poulhičs

2005-02-20, 8:47 pm

serri_amir@yahoo.fr (BiggeR) writes:

> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^/(.*) $1
>
> but doesn't work :-(


I'm not sure I understand what you want from mod_rewrite, but here,
something like "/index.php/" will be rewriten
"/index.php/" (no change, you rule does not do anything in
fact).

If you want it to be rewriten in "/index.php" , maybe you should
try:

RewriteRule ^/(.*)/.* $1

Everything of the form "/something/bla/blo/foo" will be rewritten to
"/something".

Is it what you want? mod_rewrite can return HTTP error (see
http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html)

Marc


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com