-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess
29 lines (25 loc) · 1.07 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<IfModule mod_rewrite.c>
RewriteEngine on
# ========================================================
# ==== Uncomment to check if .htaccess is working ======
# RewriteRule ^.*$ htaccess_tester.php
# ========================================================
# ========================================================
# ==== for assets files =================================
# Rewrite if the file does not exists
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite only if the URI does not starts with assets
RewriteCond %{REQUEST_URI} !^/assets
# Rewrite any assets file
RewriteRule ([^/]*).(css|js|png|jpe?g)$ assets/$1.$2 [L]
# ========================================================
# ========================================================
# ==== for index.php rewrite ===========================
# Rewrite if the file does not exists
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite if the directory does not exists
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite to add index.php
RewriteRule ^(.*)$ index.php?/$1 [L]
# ========================================================
</IfModule>