Showing posts with label SEO Server Fixes. Show all posts
Showing posts with label SEO Server Fixes. Show all posts

Tuesday, September 25, 2012

Get PHP script execution time


Get PHP Script executation time with following simple php script

PHP Script Execution Time



<?php
function page_loading_time()
{
    list ($msec, $sec) = explode(' ', microtime());
    $microtime = (float)$msec + (float)$sec;
    return $microtime;
}

// Capture current time at the Begining of the file
$start=page_loading_time();

usleep(100000);  // Delaying page output 0.1 second for testing purpose.
// Your Content Goes here


echo "<br />At the End of the File
";
$end = page_loading_time();
// Print results.
echo 'Page Loading Time: <b>' . round($end - $start, 2) . '</b> seconds';   
?>

Thursday, May 31, 2012

htaccess redirect with or without www


Developing SEO friendly website, you have to decide the domain name is whether it is with "WWW" or without "WWW". as per your need you can transform the user behavior by redirecting reversal order based on your need. If you decide without WWW mean, while user attempt to type with http://www.example.com you need to redirect http://example.com, If you decide with WWW mean, you need to redirect with www when user typing http://example.com to http://www.example.com

In this case, We have the great option in .htaccess to decide with or without WWW .
Here is the solutions for htaccess redirect with or without www

Examples with mentioning Domain Name

Redirect WWW to non-WWW or without WWW Domain Name:

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

Redirect non-WWW to with WWW Domain Name:

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





Example with Suitable for any Website without mentioning the domain name:
(Suitable for any Website) no need to tell the domain name on code.

Redirect www to non-www (both: http + https)
if we need to do this for separate http and https:

Options +FollowSymLinks
RewriteEngine On

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

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


Redirect non-www to www (both: http + https)
if we need to do this for separate http and https:


Options +FollowSymLinks
RewriteEngine On

# if without https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# if https
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]




Tuesday, March 6, 2012

How to SEO Website, Series.


Search Engine Optimization SEO, is an key work for any website to promote your business or brand through web among Search Engines. Here is the Major points as a answer for your question, We will saw one by one in this "How to SEO Website" Series.

How to SEO your Website



12. Optimize Title
11. Local Listing
10. Sitemap Submission
09. Blogger Linking
08. Sidelink Showing
07. Google Trends
06. Social Singles
05. Followed Links
04. 404 Fixes
03. 301 Fixes
02. Indented Listings
01. You will get first Place on Google