Sunday 16 February 2014

Password Protect the Directory

To password protect the wp-admin page only and to avoid authentication pop-up window on the other website pages
Follow the following steps :
  • First password protect the directory using the "Password Protect Directories" in the cPanel.
  • After that add the following code in the htaccess of the domain.
                    <IfModule mod_rewrite.c>
                     RewriteEngine On
                     RewriteCond %{QUERY_STRING} !=""
                     RewriteCond %{QUERY_STRING} !^p=.*
                     RewriteCond %{QUERY_STRING} !^s=.*
                     RewriteCond %{REQUEST_URI} !^/wp-admin.*
                     RewriteRule ^(.*)$ /$1? [R=301,L]
                    </IfModule>

  • It will show the authnetication request only for the wp-admin page

Sunday 12 January 2014

Fatal error: Class 'PDO' not found

Drupal Website showing the following error
Fatal error: Class 'PDO' not found in /public_html/drupal/includes/database/
database.inc on line 184

If your server is using the php 5.2 , upgrade the php version to php 5.3 or higher

Or you will have to enable the PDO using the easyapache

Saturday 11 January 2014

How to open the port in the server

 If you want to open an incoming TCP port, type the following in the SSH as root user:
# iptables -I INPUT -p tcp --dport 12345 --syn -j ACCEPT
# service iptables save

 If you want to open an incoming UDP port, type the following in the SSH as root user:
# iptables -I INPUT -p udp --dport 12345 -j ACCEPT
# service iptables save

wp_localize_script was called incorrectly

Website showing the following error: 
Notice: wp_localize_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /public_html/wp-includes/functions.php on line 3049

Go to wp-config.php and make the following changes and check if it will work

define('WP_DEBUG', true); to define('WP_DEBUG', false);

It is not recommended to use WP_DEBUG or the other debug tools on live sites; they are meant for local testing and staging installs.

Friday 10 January 2014

Can't locate Error.pm in @INC error

Can't locate Error.pm in @INC error in the Quickinstall

In the Quickinstall it shows the following error : 
A fatal error or timeout occurred while processing this directive
 A box should expand giving an error message followed by a traceback. If the error message gives something as following 
Can't locate Error.pm in @INC error ...

Then try executing the following command in the SSH 
# cpan Error.pm

Saturday 21 December 2013

Cannot find the robot.txt anywhere in my file manager but the domain.com/robots.txt is working

In the wordpress website the robots.txt is automatically getting generated by the following script : function do_robots() {
header( 'Content-Type: text/plain; charset=utf-8' );

do_action( 'do_robotstxt' );

if ( '0' == get_option( 'blog_public' ) ) {
echo "User-agent: *\n";
echo "Disallow: /\n";
} else {
echo "User-agent: *\n";
echo "Disallow:\n";
}
}
in the file /functions.php which is under the /wp-includes/ folder. So you can modify the code to change the robots.txt settings.

If you do not wish to show the robots.txt file you can redirect it to the 404 error page using the .htaccess

Redirect 301 /robots.txt http://www.yoursite.com/404

Thursday 19 December 2013

Your website needs to be publicly accessible to use Jetpack: site_inaccessible Error

Below error occurred while trying to connect to the WordPress.com under jetpack plugin in wp-admin panel:
Your website needs to be publicly accessible to use Jetpack: site_inaccessible Error Details: The Jetpack server was unable to communicate with your site [HTTP 503]. Ask your web host if they allow connections from WordPress.com. If you need further assistance, contact Jetpack Support: http://jetpack.me/support/

Try disabling the maintenance plugins if you have enabled and try to connect it.
The maintenance plugins like : WP Maintenance Mode and ThemeFuse Maintenance Mode
Or try disabling all the plugins that you have recently added and try if it is getting connected.

Or try deactivating the Jetpack plugin and reactivate it again and try connecting it , this worked for me .

Also check if your domain name server is updated , or updated to the right hosting account. Also check if the A record is pointing correctly.

If this is not resolved the issue you will have to contact either the http://jetpack.me/support/ or the hosting provider to check if the port is blocked or the website is blocked.

ERR_CONTENT_DECODING_FAILED

If you are getting the error as ERR_CONTENT_DECODING_FAILED while accessing the domain then add the below extension in php.ini  ++++++++...