-
Notifications
You must be signed in to change notification settings - Fork 11
/
.htaccess
37 lines (30 loc) · 1.48 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
30
31
32
33
34
35
36
37
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
RewriteEngine On
# Tell PHP that the mod_rewrite module is ENABLED.
SetEnv HTTP_MOD_REWRITE On
# We don't want to pass calls to css, script, and image files to the index,
# whether they exist or not. So quit right here, and allow direct access
# to common format files. Add formats here to allow direct link access
RewriteRule ^.*\.(gif|png|jpe?g|bmp|css|js|swf|wav|avi|mpg|ttf|woff)$ - [NC,L]
# Deny access to the aspx, frontend and system folders. All defined
# file extensions from the previous rewrite rule wont make it here, which allows
# direct access to images and such in these folders still.
RewriteRule ^aspx/ - [R=403,L,NC]
RewriteRule ^frontend/ - [R=403,L,NC]
RewriteRule ^system/ - [R=403,L,NC]
# Don't redirect direct links to non-existent files or directories to the index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Redirect all ASPX file calls to the index.php?aspx=ASPX_FILENAME
RewriteRule ^(.*)\.aspx$ index.php?aspx=$1 [QSA,L]
# Don't redirect direct links to non-existent files or directories to the index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php?uri=$1 [PT,L]
</IfModule>
<IfModule !mod_rewrite.c>
# Tell PHP that the mod_rewrite module is DISABLED.
SetEnv HTTP_MOD_REWRITE Off
</IfModule>