Rewrite Question

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
nielsenrc
New Member
New Member
Posts: 9
Joined: Thu Mar 03, 2011 7:52 pm

Rewrite Question

Post by nielsenrc »

I'm not an htaccess ninja by any means - but I've noticed that CMS Made Simple seems to honor two different ways of getting to a page:

1) http://www.yourdomain.com/page.html

&

2) http://www.yourdomain.com/page/

Does anybody know why this is - and if they do - how to fix it?

Here is my htaccess:

Code: Select all

Options +FollowSymLinks
RewriteEngine on
 
# 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,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
RewriteRule ^(.+)$ index.php?page=$1 [QSA,NE]
And here are the relevant config file settings:

Code: Select all

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

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';

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

#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';

$config['use_hierarchy'] = false;

Any ideas?
nielsenrc
New Member
New Member
Posts: 9
Joined: Thu Mar 03, 2011 7:52 pm

Re: Rewrite Question

Post by nielsenrc »

Nothing eh? All right - I guess I'll keep hacking away at it. Any input is greatly appreciated.
Post Reply

Return to “CMSMS Core”