Project

General

Profile

Actions

Bug #15130

closed

Error 404: Page not found handling not working correctly with SimulateStaticDocuments=1

Added by svobi over 18 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2005-10-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

we encountered in several typo3 setups with simulatestaticdocuments = 1 problems with the page finding routines of typo3.

if the desired page is not found, the startpage will be displayed, instead of an "Page not Found" error message from typo3.

we reported this in greater detail already to the list and found several other posts regarding this issue.

our last post in the german list was:

news://lists.typo3.org:

(issue imported from #M1694)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #15231: No error page shown when using simulatestatic even if alias doesn't existClosedMichael Scharkow2005-11-23

Actions
Actions #1

Updated by svobi over 18 years ago

i've searched in the tslib and t3lib files that are used from index_ts.php

in the file class.t3lib_page.php the following function returns 0 if it can't find the alias in the database. and returning 0 seems to always display the mainpage.

/**
 * Returns a pagerow for the page with alias $alias
 *
 * @param    string        The alias to look up the page uid for.
 * @return    integer        Returns page uid (integer) if found, otherwise 0 (zero)
 * @see tslib_fe::checkAndSetAlias(), tslib_cObj::typoLink()
*/
function getPageIdFromAlias($alias) {
$alias = strtolower($alias);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'alias='.$GLOBALS['TYPO3_DB']->fullQuoteStr($alias, 'pages').' AND pid>=0 AND pages.deleted=0'); // "AND pid>=0" is because of versioning...
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
return $row['uid'];
}
return 0;
}

if i change the return value to -1 it seems like it works like it should. the typo3 internal error404 handling triggers and displays the correct error 404 page i've configured.

but the problem with incorrect http-header still remains.
it sents 302 moved an redirects to the page that should display the error.
:-(

Actions #2

Updated by Dmitry Dulepov over 18 years ago

I posted the following solution to the "english" list:

- set in localconf.php:
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] =
'READFILE:/path/to/site/404.html';
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling_statheader"] =
'HTTP/1.0 404 Not found';
(make sure you point to existing file!)
- change .htaccess from
RewriteRule .* index.php [L]
to
RewriteRule ^[^/]*\.\d+\.\d+\.html$ index.php [L]

This way 404 is returned properly. Also Google sitemaps work with this solution.

Actions #3

Updated by Sebastian Kurfuerst over 18 years ago

Hi,
I think that's the same issue, isn't it?
Greets, Sebastian

Actions #4

Updated by Michael Scharkow over 18 years ago

The bug concerning non-existant aliases is treated in the related issue, so I'll only fix the HTTP headers issue here if you agree.

Actions #5

Updated by Michael Scharkow over 18 years ago

Incorrect HTTP headers are fixed in CVS, to set this yourself see Dmitry's comment.

Actions #6

Updated by Chris topher almost 10 years ago

  • Assignee deleted (Michael Scharkow)
  • Target version deleted (0)
  • TYPO3 Version changed from 3.8.0 to 3.8
  • PHP Version deleted (4)
  • Is Regression set to No
Actions

Also available in: Atom PDF