Handling Dynamic ഉരല്
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:
1.No of Pages
2. Access Frequency of Pages
3. Meaningful(SEO Friendly) URLs for accessing a page
4. Link Exchange
So Lets think about the appearence of a non SEO friendly URL it may look ലൈക്
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/
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
$row['SectionName'] "); } ?>
This will generate links liks
"Personal
"Technical
"Spiritual
"SEO Techniques
Some additional work can be done on this to make this a SEO friendly URL
We can change the above php code like this
$row['SectionName'] "); } ?>
This will generate links liks
"Personal
"Technical
"Spiritual
"SEO Techniques
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("$row['SectionName'] ");
and the output will be like
SEO Techniques
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
order allow,deny
deny from all
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
http://culblog.com/index.php?sec=2&id=5
[Thursday, June 19, 2008
|
0
comments
]
Popular Posts
- php questions
- some php questions
- How to create a plugin in elgg.
- php Questions
- Mysql query for searching a value, add weightage on the number of occurances and sort based on the weight-age
- Contact Me
- solving the packaging problem in PHP
- How to add or remove WWW on URLs using htaccess.
- php questions
- Inserting nodes into xml files using XML DOM in PHP .
0 comments
Post a Comment
Please put your comments here. your questions, your suggestions, also what went wrong with me.