{"id":3439,"date":"2020-12-26T20:10:46","date_gmt":"2020-12-26T20:10:46","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=3439"},"modified":"2022-02-17T07:13:47","modified_gmt":"2022-02-17T07:13:47","slug":"default-htaccess-file-to-use","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/htaccess\/default-htaccess-file-to-use","title":{"rendered":".DEFAULT .htaccess FILE TO USE"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#FORCE HTTPS\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} &#91;L,R=301]\n\n#REMOVE www FROM URL IF PRESENT\nRewriteEngine on\nRewriteCond %{HTTP_HOST} ^www\\.\nRewriteRule ^(.*)$ https:\/\/mydomain.com\/$1 &#91;R=301,L]\n#SET CORRECT DOMAIN NAME ABOVEEEEEEEEEEEEEEEEEEEEEEEEEE&lt;&lt;&lt;&lt;!!!!\n\n\n#----------- BEGIN REWRITE RULES TO BLOCK OUT COMMON EXPLOITS ----------\n## If you experience problems on your site block out the operations listed below\n\n# Block out any script trying to base64_encode crap to send via URL\nRewriteCond %{QUERY_STRING} base64_encode.*\\(.*\\) &#91;OR]\n\n# Block out any script that includes a &lt;script> tag in URL\nRewriteCond %{QUERY_STRING} (\\&lt;|%3C).*script.*(\\>|%3E) &#91;NC,OR]\n\n# Block out any script trying to set a PHP GLOBALS variable via URL\nRewriteCond %{QUERY_STRING} GLOBALS(=|\\&#91;|\\%&#91;0-9A-Z]{0,2}) &#91;OR]\n\n# Block out any script trying to modify a _REQUEST variable via URL\nRewriteCond %{QUERY_STRING} _REQUEST(=|\\&#91;|\\%&#91;0-9A-Z]{0,2})\n\n# Send all blocked request to homepage with 403 Forbidden error\nRewriteRule ^(.*)$ index.php &#91;F,L]\n\n#---------- END REWRITE RULES TO BLOCK OUT SOME COMMON EXPLOITS ----------<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-3439","post","type-post","status-publish","format-standard","hentry","category-htaccess"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=3439"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3439\/revisions"}],"predecessor-version":[{"id":3450,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3439\/revisions\/3450"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=3439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=3439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=3439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}