CMSMS MLE 1.5.2 and pretty URL; getting rid of index.php in the URL string

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
joecannes
Forum Members
Forum Members
Posts: 93
Joined: Mon Nov 26, 2007 5:00 pm
Location: Montreal, Quebec

CMSMS MLE 1.5.2 and pretty URL; getting rid of index.php in the URL string

Post by joecannes »

Hi,

I am trying to get pretty URLs to work, and I have gotten it to work, but dont know how to get rid of the index.php in my URL string.

This is code for my config_lang.php:

Code: Select all

define('DEFAULT_LANG', 'eng');


$hls = array(


 'eng' => array(
	'block'=>'en',
	'flag'=>'<img src="/mysite/images/lang/us.png" style="border:0; opacity:1;" alt="English" />',
	'text'=>'English',
	'locale_cms'=>'en_US',
 ),
 'fra' => array(
	'block'=>'fr',
	'flag'=>'<img src="/mysite/images/lang/fr.png" style="border:0; opacity:1;" alt="Français" />',
	'text'=>'Français',
	'locale'=>'fr_FR.utf8@euro',
	'locale_cms'=>'fr_FR',
 ),


);
?>

This is the code for my config.php:

Code: Select all

$config['assume_mod_rewrite'] = false;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = true;
and this is the code for my .htaccess file:

Code: Select all


# 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

# (this is important, so uncomment if your host permit)
#Options -Indexes
#ServerSignature Off
#
Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /mysite
#
# 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=$2&hl=$1 [QSA]
</IfModule>
and in my URLs, I get:

Code: Select all

http://www.mysite.com/index.php/eng/teachers-organizers.html

and

http://www.mysite.com/index.php/fra/teachers-organizers.html

Do I have to be on an Apache server to have "mod_rewrite" work, because my service provider says I am on a hybrid server,


Thanks,
Joe Cannes
alby

Re: CMSMS MLE 1.5.2 and pretty URL; getting rid of index.php in the URL string

Post by alby »

joecannes wrote: Do I have to be on an Apache server to have "mod_rewrite" work, because my service provider says I am on a hybrid server,
If you are on Linux+Windows server AND Windows has IIS you cannot use mod_rewrite (there is a expensive module for IIS).
You must use a Apache web server with mod_rewrite enable

Alby
Locked

Return to “[locked] CMSMS MLE fork”