I've configured pretty URLs with .html page extension in my cms installation - furthermore I'd like to set up my own error pages. Unfortunately I've some problems with this combination and I hope that anyone you you can give me a helpful hint to solf this problems.
When I try to access a page like "contact.httml" (invalid page extension) the system behaves as expected, it presents the nice error page I set up in the cms befor. When I try to access a page like "conttact.html" (valid page extension, but a page-name that does not exist) I get a "normal" 404-error page presented by the webserver.
My Apache2 configuration looks like this:
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 /contact.html HTTP/1.1" 200 6221 "-" "Mozilla/4.0 xxx"
xxx - - [xxx] "GET /conntact.html HTTP/1.1" 404 201 "-" "Mozilla/4.0 xxx"
xxx - - [xxx] "GET /contact.htmml HTTP/1.1" 404 3607 "-" "Mozilla/4.0 xxx"
Do you have any idea? I'm thankful for any hint!
Jan