[solved] Pretty URL gives 404?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Lucazade
New Member
New Member
Posts: 6
Joined: Thu Jul 31, 2008 1:23 pm

[solved] Pretty URL gives 404?

Post by Lucazade »

I've followed the instructions in the FAQ (http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs) to the letter, apart from the {metadata} bit, and the menu shows me that the links are generated correctly - i.e. http://site.com/parent/child/child.html, where 'parent' and 'child' correspond to the page aliases. However I keep getting 404 errors. Old style links still work, of course.

My configuration is v1.3.1 on Linux. Here's the .htaccess:

Code: Select all

Option +FollowSymLinks
RewriteEngine On
RewriteBase /


# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing lsash
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

#CMSMS Rewriting
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
and this is the config.php ...

Code: Select all

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling. 
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
What am I missing? I tried slightly different configurations (eg. RewriteRule ^(.+)\.$ index.php?page=$1 [QSA] in the .htaccess), but no luck...  :(
Last edited by Lucazade on Fri Sep 05, 2008 3:58 pm, edited 1 time in total.
Lucazade
New Member
New Member
Posts: 6
Joined: Thu Jul 31, 2008 1:23 pm

[solved] Re: Pretty URL gives 404?

Post by Lucazade »

After much head scratching, I found out that the server admin had set the AllowOverride Directive to None for the site directory.

Changing it back to the default (AllowOverride All) solved the problem.

Hopefully this will be of help to someone else ...
Pierre M.

Re: [solved] Pretty URL gives 404?

Post by Pierre M. »

Lucazade wrote: I've followed the instructions in the FAQ (http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs) to the letter,
To the letter ? The first step directs you to http://wiki.cmsmadesimple.org/index.php ... l_Settings

Pierre M.
Post Reply

Return to “CMSMS Core”