Search Optimization
  Home arrow Search Optimization arrow Page 3 - Creating Search Engine Friendly URLs w...
SEO Chat Forums  
Choosing Keywords  
Google Optimization  
Link Trading  
MSN Optimization  
Search Engine News  
Search Engine Spiders  
Search Optimization  
Web Directories  
Website Marketing  
Website Promotion  
Website Submission  
Yahoo Optimization  
SEO Tools
Adsense Calculator
AdSense Preview
Advanced Meta-Tags
Alexa Rank Tool
Check Server Headers
Class C Checker
Code to Text Ratio
CPM Calculator
Domain Age Check
Domain Typos
Future PageRank
Google Dance
Google Keywords
Google Search
Google Suggest
Google vs Yahoo
Indexed Pages
Keyword Cloud
Keyword Density
Keyword Difficulty
Keyword Optimizer
Keyword Position
Keyword Typos
Link Popularity
Link Price Calculator
Meta Analyzer
Meta Tag Generator
Multiple Link Popularity
Page Comparison
Page Size
PageRank Lookup
PageRank Search
Robots.txt Generator
ROI Calculator 
S.E. Comparison 
S.E. Keyword Position 
Site Link Analyzer 
Spider Simulator 
URL Redirect Check 
URL Rewriting 
Mobile Linux 
APP Generation ROI 
IBM® developerWorks 
SEO Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SEARCH OPTIMIZATION

Creating Search Engine Friendly URLs with PHP
By: Ivan Strouchliak
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2009-08-26

    Table of Contents:
  • Creating Search Engine Friendly URLs with PHP
  • Click Through Rates and URLs
  • Rewritten URLs
  • A Basic URL Rewrite

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating Search Engine Friendly URLs with PHP - Rewritten URLs


    (Page 3 of 4 )

    If your URLs are spidered and indexed properly, there is no need to restructure them. Keywords in the URL do not add much to rankings. Restructuring is only necessary if search bots have trouble spidering your website or if you’re developing a website from the ground up.

    If you do restructure, then it is necessary to redirect old URLs to a new location in order to maintain at least some link power. Do not get too obsessed with rewriting. If you use underscores instead of dashes, there is no reason whatsoever to migrate to dashes.

    An example of URLs rewritten to be static URLs:

    http://example.com/cars/acura/TL/

    http://example.com/cars/bmw/323.thml

    Dynamic parameters are removed and hidden in a static URL. This can be achieved with mod_rewrite. The rewriting process only hides parameters and presents a static structure to the bots. This approach is relatively difficult to implement, as it requires interaction with the database to extract the copy for the URL.

    Here are some general rules for rewriting URLs.

    • Spaces should be converted to a slash.

    • Dashes should be selected over underscores. Although there’s little difference, search engines used to treat underscores as a separate character, while dashes were treated as a space. This has changed.

    • Try to maintain a consistent style with all URLs.

    Rewriting

    When you rewrite PHP URLs you are keeping the actual URL commands intact. For example, PHP script will understand the following and execute the command accordingly:

    • http://example.com/cars/model.php?id=3&product_id=4

    but it will give a 404 error for the following URL:

    • http://example.com/cars/acura/TL/

    The rewritten URLs don’t actually exist anywhere on the server. The server still has a script which expects to receive commands through the URL string and generate pages depending on those commands. URL rewriting lets you convert PHP URLs to a set of more "natural" links with a static look.

    • Remember that you will need to redirect old URLs to the new location in order to maintain link equity (inbound and outbound) and to prevent 404 errors.

    • You will also need to modify your internal link structure.

    The standard for URL rewriting in the Apache world is mod_rewrite, which is why we are using it in this article.

    The Apache module mod_rewrite is a killer; it is a really sophisticated module which provides a powerful way to do URL manipulation. With it you can do just about any type of URL manipulation you can think of. The price you have to pay is to accept complexity, because mod_rewrite's major drawback is that it is not easy for a beginner to understand and use. And even Apache experts sometimes discover new aspects where mod_rewrite can help.

    In other words, with mod_rewrite you either shoot yourself in the foot the first time and never use it again, or love it for the rest of your life because of its power.

    You do need to know some code to pull this one off.

    Here’s some info on mod rewrite:

    I assume that you’re using an external host, which means that 99.99% of time mod_rewrite is already installed. If not, then Google will save you. Just look up "installing mod rewrite."

    Once you enable mod_rewrite, create a file called .htaccess and put it into the directory of your application. You can also choose to use httpd.conf instead of .htaccess, which has subtle differences. If you choose to go with httpd.conf, then you will need to place rewrite rules inside the <VirtualHost> element of the httpd.conf. Also keep in mind that a slash (/) will be considered to be part of the URL.

    On the other hand, .htaccess is perfect if you don’t have access to the configuration file (httpd.conf), you want customized options for a particular directory or want to be able to change options without restarting Apache server. You cannot restart the server if you’re using shared hosting. In this article I assume you’re using .htaccess.

    More Search Optimization Articles
    More By Ivan Strouchliak


       · Not only do search engines like clean URL technique, but it also brings a level of...
       · Very interesting. So URLs help security.
       · Easy and working steps! except one simple thing that can cause many troubles :The...
     

    SEARCH OPTIMIZATION ARTICLES

    - Mobile SEO: Create, Post, and Track Content ...
    - Has Your Website Been Hacked?
    - WordPress 301 Redirect: Tips and Techniques
    - Five Ways to Optimize Pages
    - Updating WordPress Tips and Techniques
    - WordPress Database Tutorial: Security, Backu...
    - Submit and Update a WordPress Plug-in
    - Are You Optimized? Use SEO Analysis
    - WordPress SEO Tips: Benchmarking Matt Cutts ...
    - How to Increase the Conversion Rate of Your ...
    - SEO Strategies: A Guide to Which Ideas Work ...
    - Setting Up Feedburner for SEO
    - How to Use Feedburner for SEO
    - Statistical Process Control Implementation i...
    - Create Focused SEO with Subtitles





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 10 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek