Hack Forums
[PHP] .htaccess file extension capitalization - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] .htaccess file extension capitalization (/showthread.php?tid=5317887)



.htaccess file extension capitalization - 3yZtwglFSCUs - Jun 25, 2016

so im using this .htaccess
Code
# Disable the server signature
ServerSignature Off

# Disable access to all file types except the following
Order deny,allow
Deny from all
<Files ~ ".(htm|html)$">
Allow from all
</Files>

# Deny access to all .htaccess files
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>


but somebody uploaded .HTML and cause 404 not found because it only allow small file extension .html how can i somewhat allow all alternating file extension capitalization like .HtMl ?


* - Shoe - Jun 25, 2016

Uhhhh...Okay, so completely uninformed guess here. Couldn't you just specify that the file extension should have toLower() or something similar called on it? I'm sure PHP has a function that takes a specific string and converts it to lowercase.


* - 3yZtwglFSCUs - Jun 26, 2016

i know but im using only web shell to administrate it :(