forked from tastyigniter/TastyIgniter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.htaccess
49 lines (40 loc) · 1.36 KB
/
example.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
38
39
40
41
42
43
44
45
46
47
48
49
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
## You may need to uncomment the following line for some hosting environments,
## to use URL Alias you need to be running apache with mod_rewrite enabled.
##
# Options +FollowSymlinks
## Turn on URL rewriting
##
RewriteEngine On
## !IMPORTANT! You may need to uncomment the following line for some hosting environments,
## If your installation resides in a subdirectory, enter the name here also
##
# RewriteBase /
## Redirect index.php from url to prevent duplicate urls
##
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*?)index\.php[^/] /$1? [L,R=301,NC,NE]
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*?)index\.php(?:/(.*))?$ /$1$2? [L,R=301,NC,NE]
## Redirect Trailing Slashes If Not A Folder...
##
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
## Block all PHP files, except index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]
## Blacklisted folders
##
RewriteRule ^assets/downloads/(.*) not_found [L]
# Handle Front Controller...
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L,QSA]
</IfModule>