How To make SEO Friendly URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amskape
    New Member
    • Apr 2010
    • 56

    How To make SEO Friendly URL

    Hi Friends , My need I depicted Below.... Please Help me how it can

    possible.


    Explanation by Example :

    Suppose, there is one website url :
    www.example.com/article.php?id= 5

    I can convert the URL in SEO friendly manner with rewrite rule in
    .htaccess file as below :
    www.example.com/article/5 [I CAN DO THIS]

    But what I want is, The name of the Article in the URL like :
    www.example.com/article/the_name_of_the _article_here [I WANT THIS]

    I tried lot for the solution of this problem but didn't got any.
    Please tell me if you can suggest any tip.

    You can contact me : <email removed>

    I am waiting for your Good help

    Regards
    Anes
    Last edited by Atli; May 16 '10, 04:12 PM. Reason: Removed excess bold formatting and the email address.
  • phobia
    New Member
    • May 2010
    • 5

    #2
    You need to create a column e.g. your article table (given that the articles are in a database) that holds that value, so that you can look it up that way.

    You could e.g. set the value automatically from the title on save just by making it lowercase, restricting it to be alfanumeric, and replace spaces with underscores.

    Example table:
    Code:
    ID     TITLE          URL_SLUG     CONTENT
    5      The Name    the_name       .....
    Then the SQL needs to be something like this:
    Code:
    SELECT title, content FROM articles WHERE url_slug = '$slug'
    Just make sure to clean the contents of $slug before running it into the query, to avoid sql injection etc.

    Does it make sense?

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      I can convert the URL in SEO friendly manner with rewrite rule in
      .htaccess file as below :
      www.example.com/article/5
      Note that changing an URL from example.com?article.php?id=5 to example.com/article/5 doesn't make the slightest difference to a search engine. As far as SEO goes, the difference this makes is negligible. Neither does putting the title in the URL. -- This may have had an effect in the past but search engines have gotten smarter and the effect it had back then has long since been eliminated.

      These sort of changes are purely cosmetic, intended for the users of the site; so they can more easily remember and/or use the URL. Usually the effort of designing a proper rewrite rule is wasted, and you always run the risk of accidentally messing up the URL, which may even hurt your SEO.

      See Dynamic URLs vs. static URLs in the Goolge Webmaster Central Blog, for example.
      If you have a dynamic URL which is in the standard format like foo?key1=value& key2=value2 we recommend that you leave the url unchanged, and Google will determine which parameters can be removed; or you could remove uncessary parameters for your users. Be careful that you only remove parameters which do not matter. Here's an example of a URL with a couple of parameters:

      Comment

      Working...