ich verzweifle gerade an einem kleinen Problem und hoffe dass mir vielleicht jemand von Euch 'nen Tipp geben kann.
Ich nutze Pretty URL's mit ".html" Dateiendung. Darüber hinaus möchte ich natürlich eigene Fehlerseiten (404) ausgeben. Diese Kombination bereitet mir allerdings Kopfzerbrechen.
Bei einer URL wie beispielsweise "/kontakt.htmml" (ungültige Dateiendung) funktioniert alles wie gewünscht, ich erhalte die "schöne" vom CMS ausgelieferte Fehlerseite. Rufe ich dagegen aber z.B. "/konntakt.html" auf (korrekte Extension mit einer Seite die es nicht im CMS gibt)... dann liefert mit der Webserver einen "normalen" 404 zurück. Ein Verhalten das ich leider nicht so ganz verstehe.
Umgebung ist ein Apache2, CMS ist die aktuellste Version.
Apache-Konfiguration :
Code: Select all
<VirtualHost ... >
...
RewriteEngine on
RewriteBase /
...
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]
### end: CMS ###
</Directory>
ErrorDocument 404 /error-404.html
</VirtualHost>
Code: Select all
...
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
...
Code: Select all
xxx - - [xxx] "GET /kontakt.html HTTP/1.1" 200 6221 "-" "Mozilla/4.0 xxx"
xxx - - [xxx] "GET /konntakt.html HTTP/1.1" 404 201 "-" "Mozilla/4.0 xxx"
xxx - - [xxx] "GET /kontakt.htmml HTTP/1.1" 404 3607 "-" "Mozilla/4.0 xxx"
Hat jemand eine Idee?
Vielen Dank, schöne Grüße und Euch allen schonmal ein schönes Wochenende....
Jan