Htaccess: Difference between revisions

From Server STB
Jump to navigation Jump to search
No edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
<Directory /var/www/html/wp-content/uploads/>
Htaccess sebagai bantuan keamanan
    php_admin_value engine Off
</Directory>


<FilesMatch "\.(php)$">
* Contoh 1
Order Deny,Allow
 
Deny from all
Buat file .htaccess
</FilesMatch>
 
<Directory "/var/www/html/wp-content/uploads/">
php_admin_value engine Off
</Directory>
 
* Contoh 2
 
Buat file .htaccess
 
<FilesMatch "\.(php)$">
Order Deny,Allow
Deny from all
</FilesMatch>
 
* Contoh 3
 
Ini di letakan di 000-default.conf
 
<Directory "/var/www/html/info/">
    <FilesMatch "\.(php)$">
        Order Deny,Allow
        Deny from all
    </FilesMatch>
</Directory>
 
Mencegah cron
 
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{QUERY_STRING} (^|&)doing_wp_cron= [NC]
    RewriteRule (.*) /$1? [R=301,L]
</IfModule>

Latest revision as of 07:37, 5 February 2024

Htaccess sebagai bantuan keamanan

  • Contoh 1

Buat file .htaccess

<Directory "/var/www/html/wp-content/uploads/">
php_admin_value engine Off
</Directory>
  • Contoh 2

Buat file .htaccess

<FilesMatch "\.(php)$">
Order Deny,Allow
Deny from all
</FilesMatch>
  • Contoh 3

Ini di letakan di 000-default.conf

<Directory "/var/www/html/info/">
   <FilesMatch "\.(php)$">
       Order Deny,Allow
       Deny from all
   </FilesMatch>
</Directory>

Mencegah cron

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   RewriteEngine On
   RewriteCond %{QUERY_STRING} (^|&)doing_wp_cron= [NC]
   RewriteRule (.*) /$1? [R=301,L]
</IfModule>