Tag: website

What is .htaccess and how to disable .htaccess?

What is .htaccess and how to disable .htaccess? .htaccess is use to modify the way Apache behaves for a directory and it’s sub-directories. It gives you an extra control on your server, like setting up custom error messages, password protect a directory, writing rewrite rules, blocking IPs etc. However, it […]

500 error when you try to access the website

If the .htaccess has an error you should get a 500 error when you try to access the website. Is that the case? You can check if mod_rewrite is compiled in with Apache doing: httpd -l | grep mod_rewrite.c If it’s not then you should re-compile Apache. You could also […]

Nginx 502 Bad Gateway error

My server went down today and after restarting, it came up with a “Nginx 502 Bad Gateway” message. At first I thought its something related to the Nginx service, so restarted the nginx service but immediately realized it wasn’t the case. Nginx receives a request on port 80 and it […]

Drupal: PHP Fatal error: Call to undefined function user_access()

An update/upgrade on the existing Drupal website may result in a following error message on the website: “PHP Fatal error: Call to undefined function user_access() in /home/user/modules/ad/ad.module on line xxx” The solution is to update a “status” entry in the Drupal Database. Access your Drupal database either from the Mysql […]

How to redirect a website using .htaccess?

How to redirect a website using .htaccess? Solution: Redirect website http://mydomain.com to http://www.mynewdomain.com RewriteEngine on RewriteCond %{HTTP_HOST} ^mydomain\.com$ RewriteRule ^(.*)$ http://www.mynewdomain.com [R=301,L] Redirect website mydomain.com with and without www requests to http://www.mynewdomain.com RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^mydomain\.com$ RewriteRule ^(.*)$ http://www.mynewdomain.com [R=301,L] Redirect requests from http://mydomain.com to […]

Fatal error: Call to undefined function mysql_connect()

When PHP is not compiled with Mysql, you see the error Fatal error: Call to undefined function mysql_connect() in filename.php on line xx on your website though the database details mentioned in the configuration file are correct. In order to solve the problem, install the “php-mysql” package using yum # […]

cPanel domain Bandwidth Limit Exceeded

The message “Bandwidth Limit Exceeded” is received on accessing a website when it exceeds the allotted bandwidth for the domain. Bandwidth Limit Exceeded The server is temporarily unable to service your request due to the site owner reaching his/her bandwidth limit. Please try again later. Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.7a PHP/5.2.9 […]