-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy path.htaccess
63 lines (51 loc) · 2.3 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
Options +FollowSymlinks
RewriteEngine On
# Scalar pages have default views that are called when a URI has no
# file extension Turn off the MultiView option (if it's on) so it
# doesn't conflict
Options -MultiViews
# To route all requests to a maintenance page, uncomment these lines
#RewriteCond $1 !^maintenance.html$ [NC]
#RewriteRule (.*) maintenance.html [R=503,L]
# To protect all hidden files and directories
# (including, most importantly, .git)
RewriteRule (^\.)|(/\.) - [R=404,L]
# Block any files in the root directory other
# than codeigniter.php and maintenance.html
RewriteCond ${REQUEST_FILENAME} -f
RewriteCond $1 !maintenance.html$
RewriteCond $1 !codeigniter.php$
RewriteRule ^([^/]+)$ - [R=404,L]
# To route the home page (book index) to some place else, uncomment
# these lines
#RewriteCond %{REQUEST_FILENAME} ^/Library/WebServer/scalar\.usc\.edu/anvc/index\.php$
#RewriteRule (.*) /Library/WebServer/scalar.usc.edu/anvc_site/ [L]
#RewriteCond %{REQUEST_FILENAME} ^/Library/WebServer/scalar\.usc\.edu/anvc/$
#RewriteRule (.*) /Library/WebServer/scalar.usc.edu/anvc_site/ [L]
# If your server is running SSL, uncomment these lines to force all
# requests through https
#RewriteCond %{SERVER_PORT} 80
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# To protect against malicious file uploads (e.g., PHP files)
# uncomment these lines
#RewriteCond %{REQUEST_FILENAME} -f
#RewriteCond %{REQUEST_FILENAME} (\.php)$ [NC]
#RewriteCond $1 !^system/(.*) [NC]
#RewriteCond $1 !^codeigniter.php(/.*)?$ [NC]
#RewriteRule (.*) - [R=404,L]
# To route to an alternative file uploads path (e.g. "uploads"
# directory) uncomment these lines and change to the desired
# location. This should match the localDir specified in
# local_settings.php
#RewriteCond "%{CONTEXT_DOCUMENT_ROOT}/uploads/$1" -f
#RewriteRule (.+) "%{CONTEXT_DOCUMENT_ROOT}/uploads/$1" [L]
# Route to codeigniter if file or directory doesn't exist
RewriteCond $1 !^codeigniter.php(/.*)?$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) codeigniter.php/$1 [L]
RewriteRule ^$ codeigniter.php [L]
# Pass through directory
RewriteCond $1 !^codeigniter.php(/.*)?$ [NC]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) codeigniter.php/$1 [L]