-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
23 lines (17 loc) · 862 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
RewriteEngine On
# Redirect to HTTPS (uncomment the following lines if SSL is set up and you want to force HTTPS)
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Base directory
RewriteBase /
# Redirect the root domain to a specific controller and action (if needed)
# RewriteRule ^$ index.php?controller=home&action=index [L,QSA]
# Skip existing files from rewriting
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite for clean URLs
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?controller=$1&action=index [L,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$ index.php?controller=$1&action=$2 [L,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([0-9]+)/?$ index.php?controller=$1&action=$2&id=$3 [L,QSA]
# Handle requests for the root URL
RewriteRule ^$ index.php [L,QSA]