Tag: apache
-
How to use .htaccess to run all .html files as .php by using PHP handlers in Apache w/o CGI?
If you are not able to find the correct Handler, Simply create a .php file with the following contents: and run/open this file in browser. Use this output in .htaccess file Create a .htaccess file at the root of your website(usually a folder named public_html or htdocs on linux servers) and add this line: Example…
-
Common PHP.ini directives list for Apache htaccess files
Maximum Execution Time and Maximum Input Time Max Upload file size and Max POST data size Output buffering toggle Expose PHP signature – toggle Maximum Input variables Maximum Memory Limit for PHP Magic Quotes toggle Register Global Variables – useless now Allow remote URL in fopen Max Execution Time for php scripts Set Timezone for…
-
Default .htaccess file for wordpress with compression and caching tweaks
Here is the default .htaccess file for wordpress If you are using cpanel, before you proceed make sure that you don’t have htaccess file already. Default File Manager settings in cpanel make it hidden .htaccess file – default code for wordpress If your WordPress Installation is inside a directory say knowledge, which means your wordpress…
-
.htaccess redirect from http to https and from non-www to www redirect – Make site permanently SSL secured
put this in your htaccess file:
-
Forcing website to https and www using htaccess on apache servers
To first force HTTPS, you must check the correct environment variable %{HTTPS} off, but your rule above then prepends the www. Since you have a second rule to enforce www., don’t use it in the first rule.
-
CORS policy for subdomains – htaccess – apache server
Works for Magento 2.2x Cross-Origin Resource Sharing header for Access-Control-Allow-Origin for Subdomains or a general format for simple copy paste:
-
How to secure a folder by whitelisting one IP using HTACCESS and denying all others
The process involves matching all requests for an IP, if the IP does not match redirect all secured directory requests. If you want to control this IP using a script, you can add 2 lines ###CUSTOM RULES### # your rules will appear here using php script ###CUSTOM RULES### Now add a script, say happy.phpand use…