1

I have recently uploaded a new site and therefore had to redirect certain pages. There are some pages from the old site which are fine to 404, so the client can do whatever they need to do at their end.

The problem I have is that these do not throw a 404.

Example: On the new site I have /servers and then furthermore: /servers/hp These are in the htaccess file as: RewriteRule ^servers servers.php [NC] and RewriteRule ^servers/([^/\.]+)/?$ server.php?s=$1 [L]

However, on the old site there was a file /servers/hp-alphaserver.php - this does not exist anymore - but there is no 404, instead it shows the page for /servers

Hope that makes sense.

4

1 に答える 1

0

それを見つけた:

RewriteCond %{DOCUMENT_ROOT}servers/([^/\.]+)/$0 !-f
RewriteRule ^servers/([^/\.]+)/[^/]+$ 404.php [L]

これにより、ファイルが実際に存在するかどうかが確認されます。

于 2013-05-15T09:23:35.297 に答える