Thursday, July 25, 2013

How to install mod_rewrite on CentOS

mod_rewrite is an Apache module used to manipulate URL's and is compiled into the base Apache HTTP Server in CentOS.

How to configure the Apache mod_rewrite module



  1. Open the Apache configuration file located at /etc/httpd/conf/httpd.conf

  2. Change AllowOverride None to AllowOverride All  One inside <Directory /> and another one inside <Directory "/var/www/html"> and then it worked. Hope it helps somebody! P.S. I didn't use Virtual Hosts


Permanently redirect users to access the site WITH or WITHOUT the 'www.' prefix



  1. Create/Open a .htaccess file in the document root folder and add the following text replacing variables with appropriate values where necessary
    # mod_rewrite
    <IfModule mod_rewrite.c>
    # Enable mod_rewrite engine
    RewriteEngine on

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

    # WITOUT 'www.'
    RewriteCond %{HTTP_HOST} ^www\.$uri\.$tld$ [NC]
    RewriteRule ^(.*)$ http://$domain/$1 [L,R=301]
    </IfModule>

    Note: Choose either WITH or WITHOUT the 'www.' prefix.  Do not include both or you will end up in a redirection loop.
    Note: If there is already an <IfModule mod_rewrite.c>directive, only copy the desired #RewriteCond and#RewriteRule lines and add them to the directive.
    Note: Replace http:// with https:// if used for a Virtual Hosts using the https protocol.
    Note: This text can also be added to the VirtualHost directive in the apache configuration file, but you can't typically move these changes to a live server, so the .htaccess file is the prefered method.

  2. Restart the Apache daemon
    service httpd restart

Wednesday, July 17, 2013

30 High-Quality Responsive Opencart Themes

Today we will show high-quality premium responsive OpenCart themes, OpenCart templates of 2013 with you. These templates design and development from ThemeForest authors with awesome overviews like mobile ready (responsive), unlimited color and style options, custom webfonts included, powerful control panels, search engine optimization (SEO) and multistore ready. This a great resource and something every designer should check out. You can use these responsive OpenCart templates for your next commercial projects (online stores, ecommerce sites, internet marketing sites).

Today we have collected a collection of top 30 OpenCart themes collection created in 2013. We hope you will like this collection. You can download these themes are below. To kick it off, here are the best OpenCart templates! I’d love to hear about them in the comments below.

Shoppica


Shoppica

Get this theme

Sellegance


Sellegance

Get this theme

Spicylicious


Spicylicious

Get this theme

R.Gen


R.Gen

Get this theme

Sellya


Sellya

Get this theme

ShopCart


ShopCart

Get this theme

AquaCart


AquaCart

Get this theme

Gentle


Gentle

Get this theme

Journal


Journal

Get this theme

Kinder


Kinder

Get this theme

Bigshop


Bigshop

Get this theme

SportStore


SportStore

Get this theme

BeautyShop


BeautyShop

Get this theme

Fortuna


Fortuna

Get this theme

ElegantCart


ElegantCart

Get this theme

Simple


Simple

Get this theme

Cupid


Cupid

Get this theme

Simplecart


Simplecart

Get this theme

Phantom


Phantom

Get this theme

Teez


Teez

Get this theme

PinShop


PinShop

Get this theme

FancyCart


FancyCart

Get this theme

MetroShop


MetroShop

Get this theme

Mega


Mega

Get this theme

Herbal


Herbal

Get this theme

Vanity Shop


Vanity Shop

Get this theme

Leisure


Leisure

Get this theme

My Stock Image


My Stock Image

Get this theme

MegaStore


MegaStore

Get this theme

UniVersum


UniVersum

Get this theme


Friday, July 5, 2013

How to unzip a zip file into a folder with the zip file's name - Bash Script



cd into the directory containing the zip files
Run command

nano run.sh

Add below code to run.sh file

#!/bin/bash
for z in *.zip
do
d=`basename $z .zip`
mkdir $d && unzip $z -d $d
done


Make it executable

chmod +x run.sh

Run it

./run.sh

If you want to delete zip files after unzip, you only need to add
rm -rf $z after mkdir $d && unzip $z -d $d