Tips And Tricks !

Below is a listing of basic tips and tricks for optimize your Website.



What is 301 Redirect

People access your site through several different URLs. If, for example, your home page can be reached in multiple ways - for instance, http://example.com/home or http://www.example.com - it's a good idea to pick one of those URLs as your preferred (canonical) destination, and use 301 redirects to send traffic from the other URLs to your preferred URL. You can also use google Webmaster Tools to set your preferred domain for google search engine.

Add the below code to .htaccess,it will ensure that all your directories and pages of your http://example.com will get correctly redirected to http://www.example.com.

Options +FollowSymLinks
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]


Please replace example.com and www.example.com in the above code with your actual domain name.
Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Back to the top of page

Make your own auto surf

This script will surf your webpages
Here is the sample
Make a html file using the following code:-


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Autosurf </title>

<style type="text/css">
* {
margin:0;
padding:0;
border:0;
}
html, body, iframe {
height:100%;
width:100%;
overflow:hidden;
}
</style>
<script type="text/javascript">
var pages = new Array(2); //amount of webpages
pages[0]="Url 1";
pages[1]="Url 2";
pages[2]="Url 3";

var time = 30; //set time to rotate

var i = 1;
function setPage()
{
if(i == pages.length)
{
i = 0;
}
document.getElementById('holder').setAttribute('src',pages[i]);
i++;
}
setInterval("setPage()",time * 1000);

</script>
</head>

<body>
<iframe id="holder" src="Url 1" frameborder="0" scrolling="no">
</iframe>
</body>
</html>



You may apply this script with random webpages. So, your Url will be
http://www.yourdomain.com/random_page.html
Same as the above sample

Back to the top of page

Backup your Website


This topic has moved to Knowledgebase (Read)



Back to the top of page

Google Analytics without Javascript

Analytics will not work, If user use browser with javascript disabled (NoScript addon).Google Analytics will not track visits on JavaScript disabled website.
You may add this code in body of your webpage <body> </body>

<img src="http://nojsstats.appspot.com/UA-123456/yourwebsite.com" />

Please replace UA-123456 with your property ID and yourwebsite.com with your website URL, You can refer to: http://nojsstats.blogspot.com/ for additional information on how to track hits with just an IMG tag.
We have tested this method and it works.

Back to the top of page

Enabled gzip compression

Compressing your website pages on the server is a great way to improve your site speed overall.
So if you set up your web server to deliver compressed files the majority of your readers will receive compressed files,
greatly improving their delivery speed.

In Apache, enabled gzip compression by adding the following to your .htaccess file:

 # compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
< files *.html> 
SetOutputFilter DEFLATE
< /files>  



Verify Your Compression
Once you've configured your server, check to make sure you're actually serving up compressed content.
Online: Use the online gzip test to check whether your page is compressed.

Google PageSpeed Insights

If you want to know your webpage size before and affter compression. You may go to

http://www.gidnetwork.com


Back to the top of page

Where is .htaccess?

.htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration

Log in your cPanel control
Go to >file manager>choose Web root>Show Hidden file>GO

where is .htaccess

Here is your .htaccess

where is .htaccess



Back to the top of page

Meta Tags for SEO

What are Meta Tags?
Meta tags give search engines more information about a web page. This is implicit information, meaning that it’s not visible to visitors of the web page itself. Meta tags can be found in the <head> </head>element of a web page.So which tags are still useful for SEO
Often, meta tags will contain a name attribute, which sets a type of metadata. The value of this metadata is expressed through a content attribute. There are all kinds of valid name-value pairs you can use within meta tags, so let’s take a look at some of them.
Title Tag

<title> relevant and attractive phrase</title>

The title is the first (usually clickable) phrase you see as a search result. The best thing to do is to make the title no longer than 100 caracters. You should see the title as a short commercial message that has to attract your visitor.
Meta http-equiv

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Meta http-equiv="Content type" tells the content type of the page.
Text/html tells that the page is done in HTML, And Charset UTF-8 tells what kind of character set it is.
Meta "cache-control" tag

<meta http-equiv="cache-control" content="no-cache" />

Control how your pages are cached. The options you have are: public (default)
- allows the page to be cached; private
- the page may only be cached in private caches; no-cache
- the page should never be cached; no-store
- the page may be cached but not archived.
Meta "Keyword" tag

<meta name="keywords" content="text">

That's wat Meta tags is all about: hones and relevant words. Specific words to describe your company, your store or business are the keystone to succesful SEO.
Meta "Discription" tag

<meta name=”description” content=”text”/>

The meta description tag is probably one of the most useful meta tags. As the name suggests, it gives search engines a short description about the page. This tag used to have a lot more ranking power.
Meta "viewport" tag

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

The viewport meta tag :- the key to preparing a page for mobile devices optimization
Meta "robot" tag

Add the following meta tag in the HTML source of your page:

<meta name="robots" content="index, follow”/>

Search engines will now index your whole website.
Search engines will not only index the first webpage of your website but also all your other webpages.
By changing the index to no-index and the follow to no-follow your are able to influence the behaviour of the spider. If you don't want the search engine spider to crawl through your whole website you use the following meta tag :

<meta name="robots" content="index, nofollow”/>

Search engines spider will now only look at this page and stops there.

<meta name="robots" content="noindex, follow”/>

Search engines spider will not look at this page but will crawl through the rest of the pages on your website.

<meta name="robots" content="noindex, nofollow”/>

Search engines spider will not look at this page and will NOT crawl through the rest of your webpages.
Meta "googlebot" tag

<meta http-equiv="googlebot" content="noarchive" />

Informs the Google search engine about indexing, archiving and link-following rules.
noarchive - Prevent Google search engine from archiving the page
nofollow - The page can be indexed, but links should not be followed
noindex - Google robots should follow links, but not index the page
nosnippet - Prevent Google search engine from saving snippets and archiving the document
Meta "revisit-after" tag

<meta name="revisit-after" content="7 days" />

You may add this revisit-after tag to all of your webpages, so not only in the first index page. Make sure that on every page relevant meta tags are added. Add keywords and phrases that are relevant and correspond to the text on that specific page. It might be a lot of work to add specific meta tags to each page but you will notice in time that it works!
Meta "Classification" tag

<meta name="Classification" content="web hosting" />

This meta tag Classifies the site into the correct category
Meta "abstract" tag

<meta name="abstract" content="a very short description of your website" />

This meta tag appears to be equal to the description meta tag but they are different. The description meta tag is used by many search engines as a small text under the click-able title. But there are several search engines that use this tag to archive your page.
Meta "Author " tag

<meta name="author" content="text(Name)" />

This meta tag has no influence on your search engine ranking. Meta tags that do have a lot of influence are the title of your page, the meta keywords tag and the description meta tags
Meta "contact" tag

<meta name="contact" content="email@address" />

This meta tag has no influence on your search engine ranking. Unfortunately spam robots make use of this email address to send you spam email.
Meta "copyright" tag

<meta name="copyright" content="2013© extrazone.net" />

This meta tag defines copyright information of the document. no influence on your search engine ranking.
Meta "distribution" tag

<meta name="distribution" content="global" />

The meta tag distribution defines the level or degree of distribution of your web-page and how it should be classified in relation to methods of distribution on the world wide web. There are currently only three forms of distribution supported by the distribution tag:
-Global - indicates that your web-page is intended for everyone,
-Local - intended for local distribution of your document,
-IU - Internal Use, not intended for public distribution.
Meta "expires" tag

<meta name="expires" content="Fri, 15 Jun 2015 12:00:00 GMT" />

This meta tag Specifies the date and time when the page expires.
Meta "generator" tag

<meta name="generator" content="Dreamweaver" />

The generator meta tag :- Specifies the name of the program that generated the document.
Meta "refresh" tag

<meta name="refresh" content="10" />

The document will display for a specified amount of time (10 Second) before refreshing

<meta name="refresh" content="5;URL=http://www.newURL.com" />

The document will display for a specified amount of time (5 Second) before switch to a new URL.
Meta "rating" tag

<meta name="rating" content="value" />

This meta tag is often use to let the younger web-surfers know the content is appropriate.
You can use on of the following values:
-general
-mature
-restricted
-14 years
Meta "notranslate" tag

<meta name="google" content="notranslate" />

When we recognize that the contents of a page are not in the language that the user is likely to want to read, we often provide a link to a translation in the search results. In general, this gives you the chance to provide your unique and compelling content to a much larger group of users. However, there may be situations where this is not desired. This meta tag tells Google that you don't want us to provide a translation for this page.
Meta "google-site-verification" tag

<meta name="google-site-verification" content="GDj5WGHU0bWc4ROG_wXkqI_4u7G0hk_iUgSP5zh1cV0" />

You can use this tag on the top-level page of your site to verify ownership for Webmaster Tools.
Meta "pagerank™" tag

<meta name="pagerank™" content="10" />

By far one of the most important metadata elements. PageRank can be easily influenced. Adding the PageRank META Tag ensures that your web pages will rank highly in Google. The value can be set anywhere from 1 to 10 with 10 being the maximum amount of PageRank you are allowed. Be sure to include the ™ symbol or Google will ignore the tag completely. PageRank™ is a trademarked term.
Meta "alexa" tag

<meta name="alexa" content="100" />

Wondering why your Alexa Rank is so low? Insert the Alexa META Tag and set the value to 100. Within 30 days you should begin to see your Alexa Rank improve by leaps and bounds. Within 60 days, you should be in the top 100 for your niche.



Back to the top of page

How to add Apache Module mod_expires

Add Apache Module mod_expires to your .htaccess
When visiting a website, the website will cache in your browser. This cache can be controlled by configuring your Cache-Control HTTP headers for your website This is done by adding mod_expires in the .htaccess file of your server. If you don't set your Cache-Control for the HTTP headers, then, you will have a longer wait times when visiting your website. Each time your website is accessed without Cache-Control, your website has to make a request to the server for each image, javascript file, CSS file, and so forth to load.In order to add browser caching to your website, you will need to set the date for when the cache expires. This cache code is placed in the .htaccess found in your public_html folder. You will need to edit your .htaccess file.
Add the following code to .htaccess file and save it.

<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/jpg "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType text/css "access plus 14 days"
</IfModule>


Now your site will set the time each for each resource that was added to the .htaccess to expire.

Recommended Expire date ranges
You do not want to set your expire times for your cache to unrealistic settings. If you keep the cache to a maximum of a year and a minimum of a month, you should have your browser caching working optimized for your site.Set your images to a long expire time like "access plus 1 year". Images take more time to load and are updated less frequently than other files
Make your CSS, HTML, and Javascript expire at a minimum of a month like "access plus 1 month". CSS, HTML and JavaScript's typically are updated more when developing a site than the sites images.
Keep your cache expire date at most a year.
You can get more detail at Google PageSpeed Insights



Back to the top of page

How to set Nameserver

Setting Nameservers Registered with GoDaddy



This topic has moved to Knowledgebase (Read)




Back to the top of page



Here is the code for random your banners

A script that will load a random banner with the corresponding link and text link
(out of three possible banners in this example).
Let's name it "banner_r.php"

<script type="text/javascript">
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
link = new initArray(
"Target Url 1",
"Target Url 2",
"Target Url 3"
);
image = new initArray(
"Banner Url 1",
"Banner Url 2",
"Banner Url 3"
);
text = new initArray(
"Text 1",
"Text 1",
"Text 1"
);
function getRandom(){
var core = Math.floor(Math.random()*3); // amount of items in array
displayBanner(core)
}
function displayBanner(theNum){
var ranlink = link[theNum];
var ranimage = image[theNum];
var rantext = text[theNum];
//document.write('<a href=\"' +ranlink+ '\" target=\"_blank\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');
document.getElementById('theImg').alt=rantext;
document.getElementById('theImg').src=ranimage;
document.getElementById('theLink').href=ranlink;
}
</script>
<a href="#" target="_blank" id="theLink"><img src="" border="0" alt="" id="theImg"></a>
<script type="text/javascript">
getRandom();
setInterval("getRandom()", 8000);
</script>




Back to the top of page

Random Webpages

Traffic exchange or autosurf may help your website have a good rank.But it will be better if you get traffic more than one page
Here is the code for random your web page

<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var howMany = 3; // max number of items listed below
var page = new Array(howMany+1);
page[0]="http:// your domain.com/page1.html";
page[1]="http:// your domain.com/page2.html";
page[2]="http:// your domain.com/page3.html";
page[3]="http:// your domain.com/page4.html";
function rndnumber(){
var randscript = -1;
while (randscript < 0 || randscript > howMany || isNaN(randscript)){
randscript = parseInt(Math.random()*(howMany+1));
}
return randscript;
}
quo = rndnumber();
quox = page[quo];
window.location=(quox);
// End -->
</SCRIPT>
</head>
<body>
</body>