How to redirect www to nonwww with https

Hello Friends,

Im back with a tip for redirection using .htaccess redirect to nonwww with https. Hope this help someone.

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

How to re-direct non WWW to WWW using web.config

Here is the URL Rewrite Rule in the IIS web.config file that redirects non-www requests to www requests for your domain name. Make sure you replace with the name of your domain.

Install Komodo Edit 8 in Ubuntu 14.04

This article gives you support on how to install Komodo Edit in Ubuntu 14.04. Komodo Edit offers support for all your major languages,including Python, PHP, Ruby, Perl, HTML, CSS ,JavaScript etc.

The installation is simple, you can done it with the following three commands from the terminal.(Press Ctrl+Alt+T to open the terminal)

sudo add-apt-repository ppa:mystic-mirage/komodo-edit

sudo apt-get update

sudo apt-get install komodo-edit

How to extract zip files from server directly using php

All of servers not providing cpanel/GUI to access the files. Uploading through FTP will be a great deal and it will time consuming if there are number of files. For eg: if we are uploading CMS like WordPress, joomla, magento, there will be no of files (more than 2000+ files).

In this case i would suggest to upload the zip file via ftp and use a php extract method by adding the following code.

$zip = new ZipArchive();
$x = $zip->open('');//your zip file name here
if ($x === true) {
 $zip->extractTo(dirname(__FILE__)); // change this to the correct site path

This will reduce the delay in uploading.

How to get Youtube Subscriber Count Using PHP

You may be facing some situations in wordpress to display the total count of youtube subscribers, you can use the below code for display the youtube subscribers count.

echo $youtube_subscriber_count = json_decode(file_get_contents(''))->entry->{'yt$statistics'}->subscriberCount;

if you are looking for a function, don’t be afraid.

function getYouTubeSubscribers($channel, $stat = 'subscriberCount')
  return json_decode(file_get_contents('' . $channel . '?v=2&alt=json'))->entry->{'yt$statistics'}->$stat;

Total Video Views:
echo getYouTubeVideoViews('anandmahalakshmi');

.htaccess Useful tips

To disable directory Browsing :

# To Disable Directory Browsing
Options All -Indexes

Domain Redirection:

.htacces code for redirecting to

RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

To Hide the Extension:

RewriteRule ^([^/.]+)/?$ $1.html