FIX_HTACCESS

This commit is contained in:
velz 2026-01-27 12:22:03 +05:30
parent 8124874d51
commit f314792076
11 changed files with 158 additions and 21 deletions

View File

@ -5,27 +5,6 @@ Options -Indexes
# Rewrite engine
# ----------------------------------------------------------------------
## ADDED for - block any script execution inside folder of public
<If "%{REQUEST_URI} =~ m#/(logo|add_image_upload|e_card_imgs|claim_sample_forms|sample_import_excel|writable)/#">
Deny from all
# Disable PHP engine
<IfModule mod_php.c>
php_flag engine off
</IfModule>
# Disable CGI and other executable handlers
Options -ExecCGI
AddHandler cgi-script .php .pl .py .jsp .asp .sh .cgi
# Block access to any script-like files entirely
<FilesMatch "\.(php|php5|php7|phtml|pl|py|cgi|ap|aspx|sh|rb)$">
ForceType text/plain
#Order allow,deny
Deny from all
</FilesMatch>
</If>
# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>

25
public/assets/.htaccess Normal file
View File

@ -0,0 +1,25 @@
# ===============================
# ABSOLUTE SCRIPT EXECUTION BLOCK
# ===============================
# Disable CGI
Options -ExecCGI
# Disable PHP for mod_php / LiteSpeed
<IfModule mod_php.c>
php_flag engine off
</IfModule>
<IfModule lsapi_module>
php_flag engine off
</IfModule>
# Block any script file access
<FilesMatch "\.(php|php5|php7|php8|phtml|phar|pl|py|cgi|asp|aspx|jsp|sh|rb)$">
Require all denied
</FilesMatch>
# Block double extensions
<FilesMatch "\.(php|php5|php7|php8|phtml|phar)\.">
Require all denied
</FilesMatch>

BIN
public/assets/1.pdf Normal file

Binary file not shown.

4
public/assets/1.php Normal file
View File

@ -0,0 +1,4 @@
<?php
echo 'Hi';
?>

View File

@ -0,0 +1,25 @@
# ===============================
# ABSOLUTE SCRIPT EXECUTION BLOCK
# ===============================
# Disable CGI
Options -ExecCGI
# Disable PHP for mod_php / LiteSpeed
<IfModule mod_php.c>
php_flag engine off
</IfModule>
<IfModule lsapi_module>
php_flag engine off
</IfModule>
# Block any script file access
<FilesMatch "\.(php|php5|php7|php8|phtml|phar|pl|py|cgi|asp|aspx|jsp|sh|rb)$">
Require all denied
</FilesMatch>
# Block double extensions
<FilesMatch "\.(php|php5|php7|php8|phtml|phar)\.">
Require all denied
</FilesMatch>

View File

@ -0,0 +1,25 @@
# ===============================
# ABSOLUTE SCRIPT EXECUTION BLOCK
# ===============================
# Disable CGI
Options -ExecCGI
# Disable PHP for mod_php / LiteSpeed
<IfModule mod_php.c>
php_flag engine off
</IfModule>
<IfModule lsapi_module>
php_flag engine off
</IfModule>
# Block any script file access
<FilesMatch "\.(php|php5|php7|php8|phtml|phar|pl|py|cgi|asp|aspx|jsp|sh|rb)$">
Require all denied
</FilesMatch>
# Block double extensions
<FilesMatch "\.(php|php5|php7|php8|phtml|phar)\.">
Require all denied
</FilesMatch>

View File

@ -0,0 +1,25 @@
# ===============================
# ABSOLUTE SCRIPT EXECUTION BLOCK
# ===============================
# Disable CGI
Options -ExecCGI
# Disable PHP for mod_php / LiteSpeed
<IfModule mod_php.c>
php_flag engine off
</IfModule>
<IfModule lsapi_module>
php_flag engine off
</IfModule>
# Block any script file access
<FilesMatch "\.(php|php5|php7|php8|phtml|phar|pl|py|cgi|asp|aspx|jsp|sh|rb)$">
Require all denied
</FilesMatch>
# Block double extensions
<FilesMatch "\.(php|php5|php7|php8|phtml|phar)\.">
Require all denied
</FilesMatch>

BIN
public/sample_excel/1.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
<?php
echo 'Hi';
?>

View File

@ -0,0 +1,25 @@
# ===============================
# ABSOLUTE SCRIPT EXECUTION BLOCK
# ===============================
# Disable CGI
Options -ExecCGI
# Disable PHP for mod_php / LiteSpeed
<IfModule mod_php.c>
php_flag engine off
</IfModule>
<IfModule lsapi_module>
php_flag engine off
</IfModule>
# Block any script file access
<FilesMatch "\.(php|php5|php7|php8|phtml|phar|pl|py|cgi|asp|aspx|jsp|sh|rb)$">
Require all denied
</FilesMatch>
# Block double extensions
<FilesMatch "\.(php|php5|php7|php8|phtml|phar)\.">
Require all denied
</FilesMatch>

25
public/writable/.htaccess Normal file
View File

@ -0,0 +1,25 @@
# ===============================
# ABSOLUTE SCRIPT EXECUTION BLOCK
# ===============================
# Disable CGI
Options -ExecCGI
# Disable PHP for mod_php / LiteSpeed
<IfModule mod_php.c>
php_flag engine off
</IfModule>
<IfModule lsapi_module>
php_flag engine off
</IfModule>
# Block any script file access
<FilesMatch "\.(php|php5|php7|php8|phtml|phar|pl|py|cgi|asp|aspx|jsp|sh|rb)$">
Require all denied
</FilesMatch>
# Block double extensions
<FilesMatch "\.(php|php5|php7|php8|phtml|phar)\.">
Require all denied
</FilesMatch>