Skip to content

Commit d43001e

Browse files
committed
Simplify the provided htaccess file with only a couple of security items and the rewrite functionality.
1 parent cf2a57c commit d43001e

1 file changed

Lines changed: 1 addition & 130 deletions

File tree

public/.htaccess

Lines changed: 1 addition & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,6 @@
1-
# ----------------------------------------------------------------------
2-
# Environment Name
3-
# ----------------------------------------------------------------------
4-
5-
# Sets the environment that CodeIgniter runs under.
6-
# SetEnv CI_ENVIRONMENT development
7-
81
# Disable directory browsing
92
Options All -Indexes
103

11-
# ----------------------------------------------------------------------
12-
# UTF-8 encoding
13-
# ----------------------------------------------------------------------
14-
15-
# Use UTF-8 encoding for anything served text/plain or text/html
16-
AddDefaultCharset utf-8
17-
18-
# Force UTF-8 for a number of file formats
19-
<IfModule mod_mime.c>
20-
AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
21-
</IfModule>
22-
23-
# ----------------------------------------------------------------------
24-
# Activate CORS
25-
# ----------------------------------------------------------------------
26-
27-
<IfModule mod_headers.c>
28-
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$">
29-
Header set Access-Control-Allow-Origin "*"
30-
</FilesMatch>
31-
</IfModule>
32-
334
# ----------------------------------------------------------------------
345
# Rewrite engine
356
# ----------------------------------------------------------------------
@@ -43,7 +14,7 @@ AddDefaultCharset utf-8
4314
# If you installed CodeIgniter in a subfolder, you will need to
4415
# change the following line to match the subfolder you need.
4516
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
46-
RewriteBase /
17+
# RewriteBase /
4718

4819
# Redirect Trailing Slashes...
4920
RewriteRule ^(.*)/$ /$1 [L,R=301]
@@ -74,103 +45,3 @@ AddDefaultCharset utf-8
7445
# Disable server signature start
7546
ServerSignature Off
7647
# Disable server signature end
77-
78-
# BEGIN Expires
79-
<ifModule mod_expires.c>
80-
ExpiresActive On
81-
ExpiresByType text/css "access 1 month"
82-
ExpiresByType text/html "access 1 month"
83-
ExpiresByType image/gif "access 1 year"
84-
ExpiresByType image/png "access 1 year"
85-
ExpiresByType image/jpg "access 1 year"
86-
ExpiresByType image/jpeg "access 1 year"
87-
ExpiresByType image/x-icon "access 1 year"
88-
ExpiresByType image/svg+xml "access plus 1 month"
89-
ExpiresByType audio/ogg "access plus 1 year"
90-
ExpiresByType video/mp4 "access plus 1 year"
91-
ExpiresByType video/ogg "access plus 1 year"
92-
ExpiresByType video/webm "access plus 1 year"
93-
ExpiresByType application/atom+xml "access plus 1 hour"
94-
ExpiresByType application/rss+xml "access plus 1 hour"
95-
ExpiresByType application/pdf "access 1 month"
96-
ExpiresByType application/javascript "access 1 month"
97-
ExpiresByType text/x-javascript "access 1 month"
98-
ExpiresByType text/x-component "access plus 1 month"
99-
ExpiresByType application/x-shockwave-flash "access 1 month"
100-
ExpiresByType font/opentype "access plus 1 month"
101-
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
102-
ExpiresByType application/x-font-ttf "access plus 1 month"
103-
ExpiresByType application/font-woff "access plus 1 month"
104-
ExpiresByType application/font-woff2 "access plus 1 month"
105-
ExpiresDefault "access 1 month"
106-
</ifModule>
107-
# END Expires
108-
109-
# ----------------------------------------------------------------------
110-
# Gzip compression
111-
# ----------------------------------------------------------------------
112-
113-
# Start gzip compression
114-
<IfModule mod_gzip.c>
115-
mod_gzip_on Yes
116-
mod_gzip_dechunk Yes
117-
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
118-
mod_gzip_item_include handler ^cgi-script$
119-
mod_gzip_item_include mime ^text/.*
120-
mod_gzip_item_include mime ^application/x-javascript.*
121-
mod_gzip_item_exclude mime ^image/.*
122-
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
123-
</IfModule>
124-
# End gzip compression
125-
126-
<IfModule mod_deflate.c>
127-
128-
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
129-
<IfModule mod_setenvif.c>
130-
<IfModule mod_headers.c>
131-
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
132-
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
133-
</IfModule>
134-
</IfModule>
135-
136-
# Compress all output labeled with one of the following MIME-types
137-
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
138-
# and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines as
139-
# `AddOutputFilterByType` is still in the core directives)
140-
<IfModule mod_filter.c>
141-
AddOutputFilterByType DEFLATE application/atom+xml \
142-
application/javascript \
143-
application/json \
144-
application/rss+xml \
145-
application/vnd.ms-fontobject \
146-
application/x-font-ttf \
147-
application/xhtml+xml \
148-
application/xml \
149-
application/x-javascript \
150-
application/x-font \
151-
application/x-font-truetype \
152-
application/x-font-otf \
153-
application/x-font-woff \
154-
application/x-font-woff2 \
155-
application/x-font-opentype \
156-
font/opentype \
157-
font/ttf \
158-
font/otf \
159-
font/eot \
160-
font/woff \
161-
font/woff2 \
162-
image/svg+xml svg svgz \
163-
image/x-icon \
164-
text/css \
165-
text/html \
166-
text/plain \
167-
text/x-component \
168-
text/xml \
169-
text/javascript \
170-
171-
# For Olders Browsers Which Can't Handle Compression
172-
BrowserMatch ^Mozilla/4 gzip-only-text/html
173-
BrowserMatch ^Mozilla/4\.0[678] no-gzip
174-
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
175-
</IfModule>
176-
</IfModule>

0 commit comments

Comments
 (0)