Simple as it could be? – CMS Made Simple

Simple as it should be? - CMS Made Simple

Setup Pretty URLs also known as Search Engine Friendly or SEF URLS

If anything is not simple then it is a CMS system. No, also the so called simple ones often are just simple for a very specific simple task. And the lack of good and ready-to-use documentation does it's job to be not as simple as it could be.

Step 1: Pre Condition

Your site is up and running and CMS is installed in a subfolder like so: http://www.DOMAIN.xyz/cms/

The default setup for not-so-pretty URL's is as follows:

Links:

http://www.DOMAIN.xyz/cms/ - main site entry point

http://www.DOMAIN.xyz/cms/index.php?page=download -  sub menu "download"

But I just want: http://www.DOMAIN.xyz/cms/download

So remove the ugly "index.php?page=" thing.

 

Step 2: Setup config.php for "mod_rewrite" pretty urls first

Edit /cms/config.php on your server via FTP.

It should read like so after editing:

I added

$config['url_rewriting'] = 'mod_rewrite';  # internal mod_rewrite
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = true;

at the end.

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysqli';
$config['db_hostname'] = 'localhost';
# [some other settings here, omitted]
$config['url_rewriting'] = 'mod_rewrite';
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = true;
?>

Now, the links should read:

http://www.DOMAIN.xyz/cms/download

So this killed the "index.php?page=" thing.

But sill http://www.DOMAIN.xyz/cms/index.php?page=download also works - but because this is not used internally and not for the menu, I think Google search engine will know anything about this...

 

Handling special characters

Go to Content > content Manager > Navigation, then "Page URL" and enter:

/videos/a1-nivel-basico

This is stupid, but simple. (If someone knows a solution for special characters beyond 7 bits, please let me know.)

Reload the site on your web browser and the link with special charachters should also work.

 

Step 3: Add and setup .htaccess.

Copy it form ./docs on your server to  your main folder "/cms/htaccess.txt". Then first edit and then 2nd rename it via FTP to ".htaccess".

 

#
# The following is to enable pretty URLS, only applicable if url_rewriting is set to 'mod_rewrite' in the config.php
#
<IfModule rewrite_module>
RewriteEngine on
# If your CMSMS installation is in a subdirectory of your domain, you may need to specify the relative path (from the root of the domain) here.
# i.e: RewriteBase /cmsms
RewriteBase /cms

# Rewrites urls in the form of /parent/child/grandchild 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>

 

NOTE: This does only ADD the "index.php?page=" to a url in the background hidden from any external url access call that does not have the index.php?page= thing in it!

Links:

Now this works, as before without any .htaccess:

http://www.DOMAIN.xyz/cms/download

http://www.DOMAIN.xyz/cms/index.php?page=download  -- but never link to this url

 

HINT: You may also need to clear your web browser cache and rebuild the php cache within your CMS!

 

 

Site logo and site icons

Next thing is icon and site-logo - you have to program and change the template ... there is no user interface for that. Including you have to render and downscale icons.

 

 

Helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *