htaccess with mod rewrite problem

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
admsh
Forum Members
Forum Members
Posts: 93
Joined: Tue Aug 19, 2008 6:30 pm
Location: NY

htaccess with mod rewrite problem

Post by admsh »

i'm trying to set up a 404 custom error page. i already have mod rewrite on, and i'm using some code for the htaccess file that came with cmsms. i've tried adding the ErrorDocument 404 command at the begining of the document and within the tages, but it just doesn't work, as if it's not there at all. what's wrong with this code?

Code: Select all

ErrorDocument 404 /error/page-not-found/

# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
#

Options -Indexes
ServerSignature Off
Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /websitems/
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 ^(.+)$ index.php?page=$1 [QSA]
</IfModule>
Pierre M.

Re: htaccess with mod rewrite problem

Post by Pierre M. »

Hello,
admsh wrote: i'm trying to set up a 404 custom error page.

Code: Select all

ErrorDocument 404 /error/page-not-found/
Either you use CMSms included feature for 404 handling
-> No need of webserver's ErrorDoc... Publish your System Information if you have an issue.
or you use your webserver's one
-> Your question is for your webserver's support board. Well, transgressing this forum rule I suggest you first retry with a simple static /404.html file.

Pierre M.
Post Reply

Return to “Developers Discussion”