Hi,
While I was reading some post on the forum, I found a CMSMS website example.
With this website http://www.shepwayonline.co.uk, how did the developer manage to get the different page file names. Like if you click on Our Services then how it is going to http://www.shepwayonline.co.uk/services.php. In the CMSMS what I have installed, if I click on some menu then it goes to
http://www.somewebsite.com/index.php?page=services.
Is there any configuration settings in the CMSMS or this is some customisation in the code done by the developer. I tried to ask the developer but haven't got any response.
Any help will be appreciated.
Regards,
Jitu
Different page file names for each page generated by CMSMS.
Re: Different page file names for each page generated by CMSMS.
There are some configuration settings inside config.php which you can use to do thatbjits wrote: Is there any configuration settings in the CMSMS or this is some customisation in the code done by the developer.
The technologie / the server module behind is named mod_rewrite. You will found a lot of threads on searching.#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = false;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';
#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'] = false;
Re: Different page file names for each page generated by CMSMS.
Hello,
http://wiki.cmsmadesimple.org/index.php ... l_Settings
It is available with Apache and Lighttpd. Not with IIS.
Pierre M.
this feature is called pretty URLs.bjits wrote: ...it is going to http://www.s.com/services.php. In the CMSMS what I have installed, if I click on some menu then it goes to
http://www.s.com/index.php?page=services.
http://wiki.cmsmadesimple.org/index.php ... l_Settings
It is available with Apache and Lighttpd. Not with IIS.
Pierre M.
-
- Forum Members
- Posts: 11
- Joined: Tue Apr 24, 2007 5:51 pm
Re: Different page file names for each page generated by CMSMS.
To pull off the bit you just described, here's how I would write the mod_rewrite rules (in .htaccess):
This should be coupled with changing config.php:
I've not tested this, so it might require a bit of tweaking. All that said, the standard pretty URLs are much prettier than engineering everything to have a .php extension. http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs
--Thomas
Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)\.php index.php?page=$1 [QSA]
Code: Select all
#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'] = '.php';
#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'] = false;
#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';
--Thomas