The 404 "page not found" page on our CMSMS (ver 1.10.3) contains the following metadata which redirects the user to the sitemap page. The URL is relative because there are several parked domains on this server which users access interchangeably (.org, .net, .com, etc'):
Code: Select all
<meta http-equiv=refresh content="5;url=sitemap/">
<meta http-equiv=Page-Exit content="blendTrans(Duration=1.0)">
Code: Select all
##### General server settings ###############################
Options -Indexes
ServerSignature Off
Options +FollowSymLinks
##### Start the CMSMS rewrite rules ###############################
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that do not contain a dot
# or trailing slash to include a trailing slash
# but ignore POST requests.
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L,NE]
# 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
RewriteCond %{REQUEST_URI} !^/certgen/
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# Remove the .php extension from the URL, remove .php, and
# use THE_REQUEST to prevent infinite loops
# due to DirectoryIndex redirects to .php files.
RewriteCond %{REQUEST_URI} !^/certgen(/.*)?$ [NC]
RewriteCond %{THE_REQUEST} ^GET\ /[^.]+\.php\ HTTP
RewriteRule ^([^.]+)\.php$ $1/ [R=301]
</IfModule>
##### Add WWW ###############################################
RewriteCond %{HTTP_HOST} ^company.com$ [NC]
RewriteRule ^(.*)$ http://www.company.com/$1 [R=301,L]
##### Remove trailing question mark #########################
RewriteCond %{THE_REQUEST} \?\ HTTP [NC]
RewriteRule .? http://www.company.com%{REQUEST_URI}? [R=301,L]
##### Cache media files #####################################
<filesMatch "\\.(flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
##### Do not cache dynamic pages #############################
<filesMatch "\.(php|cgi|rss)$">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</filesMatch>
For example, if a user attempts to load http://www.company.com/dadada/ (a non-existent URL) then the user will be correctly redirected to the 404 page and then to the sitemap page, but in their browser's address line the user will incorrectly see http://www.company.com/dadada/sitemap/ instead of the desired http://www.company.com/sitemap/ .
Any suggestions on how to fix this so that the desired pretty URL is showen?
Please help.
Thanks.