-
-
Notifications
You must be signed in to change notification settings - Fork 120
/
.htaccess
executable file
·41 lines (33 loc) · 1.17 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
38
39
40
41
# Initialization
AddDefaultCharset utf-8
Options -Indexes
# Set a fallback resource if mod_rewrite is not enabled
# Requires Apache version >= 2.2.16
# If install in subfolder the path to index.php will need to be adjusted
<IfModule !mod_rewrite.c>
FallbackResource /index.php
</IfModule>
# InstantCMS rewriting rules
<IfModule mod_rewrite.c>
RewriteEngine on
# To redirect all users to access the site without the www. prefix
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
# HTTPS redirect if available
# RewriteCond %{HTTPS} !=on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# Hide text files
RewriteRule ^.htaccess$ - [F]
RewriteRule ^credits.txt$ - [F]
RewriteRule ^readme.txt$ - [F]
RewriteRule ^license.(.*).txt$ - [F]
# Remove trailing slash from URLs
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]
# Sitemaps
RewriteRule ^sitemap(.*).xml$ ./cache/static/sitemaps/sitemap$1.xml [L]
# Engine routing
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php [L]
</IfModule>