Routing
Map URLs to Services with clean, predictable rules.
JamilX uses Apache rewrite rules to funnel requests into index.php, then resolves the matching Service based on the route query string.
Rewrite Rule
All non-file requests are rewritten to index.php with a route query value.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?route=$1 [QSA,L]
Ensure mod_rewrite is enabled in Apache and that .htaccess is respected.
Service Resolution
The first URL segment determines the Service class name. Multi-segment routes still map to the first segment.
/dashboard → class Dashboard
/blog → class blog
When no route is provided, JX falls back to the default Service name (about). A legacy rule maps /admin/blog back to the blog service.
Actions
Use the action query parameter to delegate to specific Actions within a Service (commonly read via $Url->get('action')).
/dashboard?action=home
Special Cases
The router includes tailored rules for paths like /admin/blog so legacy services continue to load correctly.
Next Step
Once routing resolves to a Service, the Service orchestrates Actions and Containers.
See Services →