-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.htaccess
executable file
·64 lines (51 loc) · 2.86 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Don't show directory listings.
Options -Indexes
# Route requests to Exponent.
DirectoryIndex index.php
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine On
# you may have to edit/uncomment the next line if running eXp from a subfolder
# RewriteBase /subfolder-name
# if moving eXp from a subfolder to root, edit/uncomment ONLY one of the next 3 lines
# Redirect 301 /testfolder http://yourdomain.org/
# RedirectMatch 301 ^/testfolder/$ http://yourdomain.org/
# RewriteRule ^testfolder/(.*)$ /$1 [R=301,NC,L]
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# To force the domain to serve the site securely using HTTPS,
# (http://www.example.com/... will be redirected to https://www.example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTPS} !=on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^.*\.git.* - [R=404]
# the next two lines will dish out .html pages if they exist, which may not be a desired effect!
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
# RewriteRule ^login.php$ login/showlogin
# Kludge out certain file types that we don't want to try to route thru the eXp router.
RewriteCond %{REQUEST_URI} !\.(css|js|pdf|shtml|htc|map)$ [NC]
# Kludge out image files that we don't want to try to route thru the eXp router.
RewriteCond %{REQUEST_URI} !\.(jpe?g|gif|png|tiff|svg|webp)$ [NC]
# Kludge out media files that we don't want to try to route thru the eXp router.
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|webm|ogv|flv|f4v|mov|mpeg)$ [NC]
# Kludge out certain other misc files that we don't want to try to route thru the eXp router.
RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]
RewriteCond %{REQUEST_URI} !^/favicon\.ico$ [NC]
# These rules basically state if it isn't an existing file, directory or symlink, route it to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
ErrorDocument 403 /index.php?controller=notfound&action=handle_not_authorized&error=403
ErrorDocument 404 /index.php?controller=notfound&action=handle&error=404
ErrorDocument 500 /index.php?controller=notfound&action=handle_internal_error&error=500