Chapter 5. URLs

Atomik provides a simple url mechanism. Whatever the page is, the url must always point to Atomik script, i.e. index.php

The url should contain a parameter which specify which action to trigger. This parameters can be modified in the configuration but its default name is “action”.

The value of the parameter must contain only the action name without any extension. So for example if you have an home.php file in the actions directory or/and an home.php file in the templates directory, you can must use “home” as parameter to call this action.

For an action to be callable, an action file or a template file must at least exists.

If the action parameter is not found in the query string, Atomik will use the default action defines in its configuration (the “atomik/default_action” key). The default is “index”.

For cleaner and prettier url you can use url rewriting. Simply the code below into a .htaccess file in the same directory as Atomik core file.

RewriteEngine on
RewriteRule ^app/ - [L,F]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?action=$1 [L,QSA]
		

This code will also prevent access to the app folder from the web.