I am using URL rewrite in my sites .htaccess file so we have pretty URL's.
This is also blocking my custom designed 404 error page code in the same .htaccess file.
ErrorDocument 404 /404.php
CMSms version 1.10.3
Commenting out the URL rewrite code proves that the (ErrorDocument 404 /404.php) does function.
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /
# 301 Redirect all requests that don't 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]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
Your help is greatly appreciated.
Thank you
Custom 404 error page doesn't function Rewrite Urls [Solved]
Custom 404 error page doesn't function Rewrite Urls [Solved]
Last edited by Joesurf on Thu Dec 19, 2013 4:29 am, edited 1 time in total.
Re: Custom 404 error page doesn't function with Rewrite Urls
This doesn't matter but, I'm curious, why the rewrite rules were not included in your post? Is the code below in the .htaccess file?
Anyway, I use CMS Made Simple's 404 error page management so I can control the content the visitor sees from within the CMSMS Admin Console. Just create a page using Content Type set to Error Page. You can control the content, choose a template, etc...
The reason I do this is because setting default error documents can differ depending upon your server software (Apache, Litespeed, Lighttpd, etc.,) and the version. CMSMS takes the guesswork out of it and allows my clients to manage their 404 content from within the CMS which can help with marketing, usability, and etc...
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]
The reason I do this is because setting default error documents can differ depending upon your server software (Apache, Litespeed, Lighttpd, etc.,) and the version. CMSMS takes the guesswork out of it and allows my clients to manage their 404 content from within the CMS which can help with marketing, usability, and etc...
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
Custom 404 error page doesn't function with Rewrite Urls -So
Ok - so now that I am sufficiently embarrassed after spending over an hour searching for the obvious CMSms answer to my custom 404 page within CMSms, you are a hero with your answer.
I looked everywhere - except the page content type!
Made the content type change in about 20 seconds and all is functioning as desired.
Yes the rewrite rules are in place:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]
Thanks so much for your help!
Joe
I looked everywhere - except the page content type!
Made the content type change in about 20 seconds and all is functioning as desired.
Yes the rewrite rules are in place:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]
Thanks so much for your help!
Joe
