-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
22 lines (18 loc) · 777 Bytes
/
.htaccess
File metadata and controls
22 lines (18 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<IfModule mod_rewrite.c>
#Options +FollowSymLinks -MultiViews
RewriteEngine on
# If the URI is not .htm and doesn't have any additonal params, try .htm
# RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(?![^/]+\.htm)([^/]+)$ $1.htm [NC,L]
# Adding the R flag causes the URI to be rewritten in the browser rather than just internally
# If the URI is .htm but it doesn't exist, pass to index.php
# RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/\.]+\.htm)$ $1/no [NC,L]
# Passes requested path as 'q' to index.php
RewriteCond $1 !^(index\.php|robots\.txt)
# RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [NC,L]
</IfModule>