{"version":"1.0","provider_name":"JR-Photo.be","provider_url":"https:\/\/blog.jr-photo.be","author_name":"jr-photo.be","author_url":"https:\/\/blog.jr-photo.be\/author\/jr-photo-be\/","title":"Clean and nice URL for Koken CMS","html":"In order to have your Koken CMS use clean and nice url like\u00a0<a href=\"\/\/www.jr-photo.be\/albums\/portrait\/\" target=\"_blank\" rel=\"noopener noreferrer\">\/\/www.jr-photo.be\/albums\/portrait\/<\/a> instead of\u00a0\/\/www.jr-photo.be\/index.php?albums\/portrait\/ you can add rewriting rule in the http conf file of your Koken Photo CMS website.\n\nBe sure to have the mod rewrite enabled (sudo a2enmod rewrite).\n\nThe rewriting rules need to be put in the directory part of the conf:\n<blockquote>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code>&lt;Directory \/var\/www\/koken\/koken&gt;<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  Options FollowSymLinks<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  AllowOverride All<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  Order allow,deny<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  allow from all<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  &lt;IfModule mod_rewrite.c&gt;<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteEngine On<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteBase \/koken<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  # Pass images requests back to PHP if they do not exist<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} \/koken\/storage\/cache\/images(\/(([0-9]{3}\/[0-9]{3})|custom)\/.*)$<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . \/koken\/i.php?path=%1 [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Pass albums requests back to PHP if they do not exist<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} \/koken\/storage\/cache\/albums(\/([0-9]{3}\/[0-9]{3})\/.*)$<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !favicon.ico<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !pagespeed<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !favicon.ico<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . a.php?path=%1 [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Do not enable path rewriting for files that exist<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-d<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !favicon.ico<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !pagespeed<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !favicon.ico<\/code><\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #808080;\"><code># Redirect everything else to custom site path<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-d<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule (.*)?$ \/$1 [R=301,L]<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  &lt;\/IfModule&gt;<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  &lt;\/Directory&gt;<\/code><\/span><\/p>\n<\/blockquote>\n<blockquote style=\"padding-left: 30px;\">\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code>&lt;Directory \/var\/www\/koken&gt;<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  Options FollowSymLinks<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  AllowOverride All<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  Order allow,deny<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  allow from all<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code>&lt;IfModule mod_rewrite.c&gt;<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteEngine On<\/code><\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #808080;\"><code># Pass images requests back to PHP if they do not exist<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} \/koken\/storage\/cache\/images(\/(([0-9]{3}\/[0-9]{3})|custom)\/.*)$<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . \/koken\/i.php?path=%1 [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Pass albums requests back to PHP if they do not exist<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_METHOD} =GET<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} \/koken\/storage\/cache\/albums(\/([0-9]{3}\/[0-9]{3})\/.*)$<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !favicon.ico<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !pagespeed<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !favicon.ico<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . a.php?path=%1 [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Catch root requests (pjax)<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_METHOD} =GET<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} ^\/?$<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{QUERY_STRING} _pjax=<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{DOCUMENT_ROOT}\/koken\/storage\/cache\/site\/index\/cache.phtml -f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule .* \/koken\/storage\/cache\/site\/index\/cache.phtml [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Catch root requests<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_METHOD} =GET<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} ^\/?$<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{QUERY_STRING} !_pjax=<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{DOCUMENT_ROOT}\/koken\/storage\/cache\/site\/index\/cache.html -f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule .* \/koken\/storage\/cache\/site\/index\/cache.html [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Catch site requests (pjax)<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_METHOD} =GET<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{QUERY_STRING} _pjax=<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{DOCUMENT_ROOT}\/koken\/storage\/cache\/site%{REQUEST_URI}cache.phtml -f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . \/koken\/storage\/cache\/site%{REQUEST_URI}cache.phtml [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Catch site requests<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_METHOD} =GET<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{QUERY_STRING} !_pjax=<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{HTTP_COOKIE} !share_to_tumblr=<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{DOCUMENT_ROOT}\/koken\/storage\/cache\/site%{REQUEST_URI}cache.html -f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . \/koken\/storage\/cache\/site%{REQUEST_URI}cache.html [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># CSS \/ RSS caching<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_METHOD} =GET<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{DOCUMENT_ROOT}\/koken\/storage\/cache\/site%{REQUEST_URI} -f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule . \/koken\/storage\/cache\/site%{REQUEST_URI} [L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Rewrite any old URLs that still use index.php?\/this\/that syntax<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{QUERY_STRING} ^\/(.*)<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule ^index.php %1? [R,L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Rewrite any old URLs that still use index.php\/this\/that syntax<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule ^index.php\/(.*)$ $1 [R,L]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Catch root requests<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule ^(index.php)?$ \/koken\/app\/site\/site.php?url=\/&amp;base_folder=\/ [L,QSA]<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># Do not enable path rewriting for files that exist and mod_pagespeedpage<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-f<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !-d<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_FILENAME} !favicon.ico<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !pagespeed<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteCond %{REQUEST_URI} !favicon.ico<\/code><\/span><\/p>\n<p style=\"text-align: left; padding-left: 30px;\"><span style=\"color: #808080;\"><code># For requests that are not actual files<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  # rewrite to index.php?\/PATH<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  RewriteRule ^(.*)$ \/koken\/app\/site\/site.php?url=\/$1&amp;base_folder=\/ [L,QSA]<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  &lt;\/IfModule&gt;<\/code><\/span>\n<span style=\"color: #808080;\"> <code>  &lt;\/Directory&gt;<\/code><\/span><\/p>\n<\/blockquote>\nThat's all!\n\nNote that I did find plenty of informations on\u00a0<a href=\"\/\/kokensupport.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/\/kokensupport.com\/<\/a> to have this working.\n\nThat's all. See it live on my photo website: www.jr-photo.be\n\nJonathan","type":"rich"}