Skip to content

Commit e91105e

Browse files
committed
Disabling TRACE Method to prevent access to sensitive header information
1 parent 1800501 commit e91105e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.htaccess

+9-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ IndexIgnore *
3838
RewriteRule ^index/(.+?)/$ index.php?page=$1 [L,QSA]
3939

4040
# skip all files and directories from rules below
41-
RewriteCond %{REQUEST_FILENAME} -d [OR]
41+
RewriteCond %{REQUEST_FILENAME} -d [OR]
4242
RewriteCond %{REQUEST_FILENAME} -f [OR]
4343
RewriteCond %{REQUEST_FILENAME} -l
4444
RewriteRule ^ - [L]
@@ -49,15 +49,15 @@ IndexIgnore *
4949
RewriteRule .* %1/index.php?page=%2 [L]
5050

5151
# Checks to see if the user is attempting to access a valid file,
52-
# such as an image or css document, if this isn't true it sends the
53-
# request to the front controller, index.php
52+
# such as an image or css document, if this isn't true it sends the
53+
# request to the front controller, index.php
5454
RewriteCond %{REQUEST_FILENAME} !-f
5555
RewriteCond %{REQUEST_FILENAME} !-d
5656
RewriteRule ^(.*)$ index.php/$1 [L]
5757

5858
# Ensure Authorization header is passed along
59-
RewriteCond %{HTTP:Authorization} .
60-
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
59+
RewriteCond %{HTTP:Authorization} .
60+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
6161

6262
# Deny Access to Hidden Files and Directories
6363
RewriteCond %{SCRIPT_FILENAME} -d [OR]
@@ -80,6 +80,10 @@ IndexIgnore *
8080
RewriteRule ^vendor/(.*)?$ / [F,L]
8181
RewriteRule ^composer\.(lock|json)$ / [F,L]
8282

83+
# Disabling TRACE Method to prevent access to sensitive header information
84+
RewriteCond %{REQUEST_METHOD} ^TRACE
85+
RewriteRule .* - [F]
86+
8387
</IfModule>
8488

8589
# Extra Security Headers

0 commit comments

Comments
 (0)