SEARCH ENGINE OPTIMISATION (SEO) TECHNIQUES
PAGES : [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
Handling Dynamic URLs
One of the major reasons for using a server-side
language such as PHP is for the ability to generate
dynamic content. Often this will lead to single scripts
that produce their content based on the input
parameters (that is, the variables in the URL).
SEO friendly URLs
The SEO friendly URLs are highly encouraged for using in
Dynamic Sites Navigation.
Some facts which helps in pretty good indexing of pages are:
So Lets think about the appearence of a non SEO friendly URL
it may look like
http://culblog.com/index.php?sec=2&id=5
Based on the supplied URL parameters 'sec' and 'id' the respective item is fetched and shown in the browser.Here the index page is manupulated for the variant display of items.
Search engines are less efficient in indexing Dynamic URLs .Inorder to over come such a situation we can do some alterations in this URL and make it more meaningful for Searchengines as well as users of the website.
I will give a suggestion for the above URL like the one below
http://culblog.com/index/technical/2/sectechniques/5/
This looks more meaningful right :).
By this technique
How to generate SEO friendly URLs
This is not much complex step.Its like generating the synamic URLs but some
more meaning ful fields added in the URL.
A sample script for creating the dynamic URL
If you check the fourth URL you can find a space between 'SEO' and 'Techniques'
in such cases you can replace the space with an hyphen (-).
print("<a href='http://www.culblog.com/topics/");
print(strreplace("","-",$row['SectionName'])/$row['Id']/'>");
print($row['SectionName'] </a>");
and the output will be like
<a href='http://www.culblog.com/topics/SEO-Techniques/4/'>SEO Techniques </a>
Avoid use of '_' instead of '-'.
Next question is how to access this URL or how Browser identify this SEO friendly URLs
This magic is done by the HTACCESS file which is placed in root of your web directory.
.HTACCESS file and URL rewrite rule
.HTACCESSFILE : .htaccess is the default name for a file that is used to indicate
who can or cannot access the contents of a specific file directory from the Internet or an
intranet. The .htaccess file is a configuration file that resides in a directory and
indicates which users or groups of users can be allowed access to the files
contained in that directory.It may also contain some rewrite rules which say
the server to access a page in it if the URL on the browser address bar satisfies
any of the rewrite rules on .htaccess file.
A sample .htaccess file
all requests to whatever.htm will be sent to whatever.php:
Lets rewrite our Example URLs
the .htaccess file content will be like this
Use of Site Map
Usually saved as sitemap.html or sitemap.php ...etc
This file will be having the list of all possible or most
important links of Your website and the URL in it should be in
SEO friendly mode.This will help in links traversal of search engines
which finally result in indexing.
PAGES : [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
Handling Dynamic URLs
One of the major reasons for using a server-side
language such as PHP is for the ability to generate
dynamic content. Often this will lead to single scripts
that produce their content based on the input
parameters (that is, the variables in the URL).
SEO friendly URLs
The SEO friendly URLs are highly encouraged for using in
Dynamic Sites Navigation.
Some facts which helps in pretty good indexing of pages are:
- No of Pages
- Access Frequency of Pages
- Meaningful(SEO Friendly) URLs for accessing a page
- Link Exchange
So Lets think about the appearence of a non SEO friendly URL
it may look like
http://culblog.com/index.php?sec=2&id=5
Based on the supplied URL parameters 'sec' and 'id' the respective item is fetched and shown in the browser.Here the index page is manupulated for the variant display of items.
Search engines are less efficient in indexing Dynamic URLs .Inorder to over come such a situation we can do some alterations in this URL and make it more meaningful for Searchengines as well as users of the website.
I will give a suggestion for the above URL like the one below
http://culblog.com/index/technical/2/sectechniques/5/
This looks more meaningful right :).
By this technique
- You can use a Static like Dynamic URL which is more meaningful to User and the search engine.
- Hide the technology or language you have used for creating the website.
- Easily Indexibile for Search Engines.
- Gives a feel to Web crawlers that the site have lots of pages under lots of virtual folders.
- Makes Easily trackable URLs.(You can easily track from the list of URLs popdown from the addressbar of Browser).
How to generate SEO friendly URLs
This is not much complex step.Its like generating the synamic URLs but some
more meaning ful fields added in the URL.
A sample script for creating the dynamic URL
<?php $qry="Select Id,SectionName from tbl_SECTION "; $result=getRecords($qry); while($row=mysql_fetch_array($result)){ print("<a href='detail.php?sec=$row['Id']'>$row['SectionName'] </a>"); } ?> This will generate links liks "<a href='detail.php?sec=1'>Personal </a> "<a href='detail.php?sec=2'>Technical </a> "<a href='detail.php?sec=3'>Spiritual </a> "<a href='detail.php?sec=4'>SEO Techniques </a> Some additional work can be done on this to make this a SEO friendly URL We can change the above php code like this <?php $qry="Select Id,SectionName from tbl_SECTION "; $result=getRecords($qry); while($row=mysql_fetch_array($result)){ print("<a href='http://www.culblog.com/topics/"); print($row['SectionName']/$row['Id']/'>$row['SectionName'] </a>"); } ?> This will generate links liks "<a href='http://www.culblog.com/topics/Personal/1/'>Personal </a> "<a href='http://www.culblog.com/topics/Technical/2/'>Technical </a> "<a href='http://www.culblog.com/topics/Spiritual/3/'>Spiritual </a> "<a href='http://www.culblog.com/topics/SEO Techniques/4/'>SEO Techniques </a> |
If you check the fourth URL you can find a space between 'SEO' and 'Techniques'
in such cases you can replace the space with an hyphen (-).
print("<a href='http://www.culblog.com/topics/");
print(strreplace("","-",$row['SectionName'])/$row['Id']/'>");
print($row['SectionName'] </a>");
and the output will be like
<a href='http://www.culblog.com/topics/SEO-Techniques/4/'>SEO Techniques </a>
Avoid use of '_' instead of '-'.
Next question is how to access this URL or how Browser identify this SEO friendly URLs
This magic is done by the HTACCESS file which is placed in root of your web directory.
.HTACCESS file and URL rewrite rule
.HTACCESSFILE : .htaccess is the default name for a file that is used to indicate
who can or cannot access the contents of a specific file directory from the Internet or an
intranet. The .htaccess file is a configuration file that resides in a directory and
indicates which users or groups of users can be allowed access to the files
contained in that directory.It may also contain some rewrite rules which say
the server to access a page in it if the URL on the browser address bar satisfies
any of the rewrite rules on .htaccess file.
A sample .htaccess file
all requests to whatever.htm will be sent to whatever.php:
DirectoryIndex index.php <Files .htaccess> order allow,deny deny from all </Files> Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)\.htm$ $1.php [NC] |
Lets rewrite our Example URLs
the .htaccess file content will be like this
Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)\.htm$ $1.php [NC] RewriteRule ^topics/(.+)/([0-9]+)/(.+)/([0-9]+)/$ http://%{SERVER_NAME}/index.php?sec=$2&id=$4 [nc] |
Here the SEO URL http://www.culblog.com/topics/seo-techniques/4/generate-seo-friendly-url/23 will be rewrited to http://www.culblog.com/index.php?sec=4&id=23 |
Use of Site Map
Usually saved as sitemap.html or sitemap.php ...etc
This file will be having the list of all possible or most
important links of Your website and the URL in it should be in
SEO friendly mode.This will help in links traversal of search engines
which finally result in indexing.
DOWNLOAD THIS TUTORIAL!! |
Comments
Post a Comment