How To make SEO Friendly URL

Discussion in 'PHP' started by amskape, May 15, 2010.

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


    Explanation by Example :

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

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

    But what I want is, The name of the Article in the URL like :
    www.sitename.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 : anes.pa@gmail.com

    I am waiting for your Good help

    Regards
    Anes
     
    amskape, May 15, 2010 IP
  2. Vekseid

    Vekseid Peon

    Messages:
    124
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Add a couple of extra columns to the article table - one being the appropriate url, the other a hash with a short (3 or 4 byte) index. So rather than look for '5', you look for the hash of 'article/the_name_of_the_article_here'
     
    Vekseid, May 15, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Using DB + .htaccess with mod_rewrite solves your problem :)
     
    roopajyothi, May 16, 2010 IP
  4. manko24

    manko24 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    @amskape
    the_name_of_the_article_here is not unique , consider wat if in future you create another article with the same name ?
    Solution
    sitename.com/the_name_of_the_article_here_id or siename.com/id/the_name_of_the_article_here
    where id is unique id , probably from your database article table.
     
    manko24, May 16, 2010 IP
  5. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well, if you run any CMS, You can just configure it to make URL like that :)

    Are you running on Any CMS? Or Just running a Basic PHP site?

    If it is a CMS, Simply google for the thing you need and you can get it solved :)

    Or else. that would make some Time of Yours :|

    Thanks
     
    extremephp, May 16, 2010 IP