You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to enable SEO-friendly URLs for CMS Made Simple

Practice




how to enable SEO-friendly (human-readable) URLs for CMS Made Simple

very simple
in config.php
write

$config['dbms'] = 'mysqli';
$config['db_hostname'] = '';
$config['db_username'] = '';
$config['db_password'] = '';
$config['db_name'] = '';
$config['db_prefix'] = 'cms_';
$config['timezone'] = 'Europe/Kiev';

$config['url_rewriting'] = 'mod_rewrite';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
$config['page_extension'] = '/';


and create a file in the root .htaccess

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]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)