-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhtaccess_rules.txt
73 lines (57 loc) · 2.06 KB
/
htaccess_rules.txt
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
65
66
67
68
69
70
71
72
php_value upload_max_filesize 64M
php_value post_max_size 64M
###---Uncomment one of the following sections' single-# lines to
###---enable specific URL handling types. If you have the domain
###---set to use www, uncomment the first, if using non-www, uncomment the second.
##--Rewrite to www in a generic way that requires no special rules
#RewriteEngine On
#RewriteBase /
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
##--Rewrite to non-www in a generic way
#RewriteEngine On
#RewriteBase /
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
###---End of URL rules---###
#--Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
#--Prevent directory listings
Options All -Indexes
#--Rewritten rewrite to only require one pass for nonexistent files/folders
#----!!!-May or may not work, still kind of testing
RewriteEngine on
RewriteBase /
RewriteCond $1 ^(index\.php)?$ [OR]
RewriteCond $1 \.(gif|jpg|css|js|ico)$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ - [S=1]
RewriteRule . /index.php [L]
#--Redirects to another URL entirely
Redirect 301 / domain-to-redirect-to
#--Add some common file types
#--A complete list can be viewed here: http://www.htaccess-guide.com/adding-mime-types/
Addtype font/eot .eot
Addtype font/truetype .ttf
AddType image/svg+xml .svg .svgz
AddType image/x-icon .ico
AddType application/x-shockwave-flash .swf
AddType video/mpeg .mpeg .mpg .mpe
AddType video/quicktime .qt .mov
#--Uncomment and Add a file extension to force the browser to download instead of stream
#--Use multiple lines to add multiple extensions
# AddType application/octet-stream FILEEXTENSIONGOESHERE
#--force www and SSL in two parts
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]