In: Computer Science
Explain line-by-line what the following snippet code from a .htaccess (WordPress) file means:
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
Some areas of the WordPress installation should never be accessible by the average users. It is always a good practice to block all access to these files. You can set up the access restrictions by adding the snippet to the .htaccess file.
where
rewirteengine will rewrite this htaccess file again and again incase if someone edit forcefully
RewriteBase /~new/
or
RewriteBase <path> // path where htaccess protection wants to
apply
RewriteRule ^wp-admin/includes/ - [F,L] // all the wordpress admin/includes will not be accissible by any of the extruders
RewriteRule !^wp-includes/ - [S=3] // wordpress include
directories
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] // all php extension
files
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] // all
php file with given directory
RewriteRule ^wp-includes/theme-compat/ - [F,L] // all files inside
theme-compat directory
if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)