Category: Apache directives
-
Ways to block user via .htaccess
-
How to fix Magento2 apis not working? fix coupon apis and other PUT OPTIONS APIs
The issue is actually related to your server’s configuration. By default all types of requests are not allowed. Please add the following to your .htaccess file
-
How to put a site in maintenance? [Apache web server]
Content of your .htaccess file If you want to whitelist any IP, use this Here is a sample htaccess for a wordpress website with 1 IP whitelisted 4.129.45.44 and all others are banned. So you only will be able to load the website while everyone else will see contents of index.html with HTTP Status code…
-
Basic Authentication in nginx for any domain, server or location block
Update the domain.conf file like /etc/nginx/conf.d/vhosts/myrestricteddomain.com.ssl.conf Ideally, use it in server config Save and restart nginx
-
Basic Authentication with Nginx with proxy port (react/node app etc)
Reference: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ Requirements: apache2-utils or httpd-tools Use htpasswd utility and create a .htpasswd file, see reference After that, just add lines in nginx conf Restart nginx now or test first using “nginx -t”
-
Sample .htaccess for Laravel with PHP FPM
-
How to whitelist IPs in NGINX configuration?
Add this code in your .conf file
-
How to fix Undefined class constant ‘ARRAY_AS_PROPS’ Fatal Error?
I received this error “Fatal Error: Uncaught error in Undefined class constant ‘ARRAY_AS_PROPS’”This issue is not related to PHP if you have 7.0 and above, it is zend framework’s module zend-http wrapper which is affected if Apache module is not present File responsible: zendframework\zend-http\src\Header\Cookie.php:75 Solution Do check enabled modules for Apache, I found out that…
-
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…
-
5 ways to redirect your Web page?
Hi Everyone! In this post we will be learning about redirects. And see how you can redirect your web-page. We will see two ways to redirect web-pages: Through your registrars’ Cpanel. Right into your code. Through cPanel redirect feature You can easily redirect your visitors from one page to another with the help of the Redirects feature. …