Accessing Website Stats without logging into cPanel



Some settings for redirection in .htaccess :

Redirecting traffic to an entirely new domain name

    #
    RewriteEngine On
    RewriteRule ^(.*)$ http://www.domain-2.com/$1 [R=301,L]
    #

Redirecting traffic from one folder to another

   #
   RewriteEngine On
   RewriteRule ^directory-1/(.*)$ http://www.example.com/directory-2/$1 [R=301,L]
   #

Redirecting a domain name to a sub folder

   #
   RewriteEngine On
   RewriteCond %{HTTP_HOST} example.com
   RewriteCond %{REQUEST_URI} !directory/
   RewriteRule ^(.*)$ directory/$1 [L]
   #


A 301 redirect can also be used to add or remove the www in front of your domain name.  This is helpful where there is an SSL certificate installed on your site because typically an SSL only secures 1 version of 

the domain name.  The secured domain name typically does or does not include www.

To avoid purchasing 2 SSL certificates you can use the following example:

Forcing WWW or Non-WWW

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


Reference:
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AllFAQ/UserSubmitted

Add Feedback