Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down 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.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 :
    http://www.sitename.com/article/the_...e_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.

    I am waiting for your Good help

    Regards
    Anes
    Last edited by oracleguy; 05-16-2010 at 06:59 AM. Reason: remove email address and removed bold typeface

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    article.php?id=5 is a SEO friendly URL just like showthread.php?t=196155, which is the URL of this thread. When you Google coding problems you will find that the threads on CodingForums come up regularly on the 1st page of the results, sometimes within hours - now that's SEO friendly as you can get.



    --------------
    Leonard Whistler

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Saskatchewan, Canada
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The only problem with doing it that way would be if one article has the same name as another.

    You could have it so that you use

    http://www.sitename.com/article.php?...icle_name_here

    and it looks for the name in the database rather than the id number.

    I would include the id number in the url so that there isn't any confusion and just have the article name tag along.

    www.sitename.com/article/5/name_of_article/

  • #4
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    This thread is number 8 first page by searching thread title: How To make SEO Friendly URL And only 2 1/2 hours after original post.


    http://www.google.com/#hl=en&source=...59ab474882bfe2



    --------------
    Leonard Whistler

  • #5
    New to the CF scene
    Join Date
    May 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    its very easy use any fuction depend on replace ' ' to '_' and add it in the title of the page for the url

  • #6
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    As Len mentioned, all valid URI's are search engine 'friendly'. The whole S.E.O thing is a term thrown around and used so that the people spouting it can sell their software and/or services. Crap or nonexistent content will lead to crap ranking no matter what your URI format, and the converse also applies. Good content, well indexed and ranked.

    I've yet to see one S.E.O "expert" prove otherwise, or even have a believable argument to the contrary.

  • #7
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    These types of URLs are probably better explained and sold as USER friendly rather than SEO friendly. I agree with Len, search engines these days are smart. The URLs are easier to understand semantically from a user point of view, which is why -- and only why -- I find them useful. But they don't really help SEO a huge amount.

  • #8
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by kbluhm View Post
    The URLs are easier to understand semantically from a user point of view, which is why -- and only why -- I find them useful.
    Aye, they can be handy in that regard. If someone just drops a link on a page, the title inclusion in the link can give one a passable idea of what it's about.

  • #9
    New to the CF scene
    Join Date
    May 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SEO Friendly URL

    As it is admitted fact that google dont give more attention to seo friendly URL but it will increase the points. Google mostly gives importance to Meta Values + Contents in the body.

    There are various ways to make search engine friendly URL but remember two points.

    1. only use alpha numeric and - sign in the place of space character.
    2. dont make it lengthy, it should be 100% relevant to topic


    Thanks & Regards

  • #10
    Regular Coder
    Join Date
    Jul 2010
    Posts
    185
    Thanks
    3
    Thanked 42 Times in 42 Posts
    I agree with most of what the other posters are saying. These 'pretty' URLs won't do much for SEO but can be easier for users.

    To answer your question. Assuming your .htaccess file looks something like this:
    Code:
    Options +FollowSymLinks
    RewriteEngine On
    
    RewriteRule ([^/]*)/([^/]*) index.php?type=$1&id=$2 [L]
    Where your index.php will take the "type" parameter as "article", "examples", "something else" etc. And "id" is the article id, then once the first two parameters are given, the rest make no difference.

    For example:
    Code:
    http://www.mysite.com/article/5
    http://www.mysite.com/article/5/The-Article-Title
    http://www.mysite.com/article/5/Some-Random-Text
    All these links will resolve to the same article (index.php?type=article&id=5)
    You can give it whatever title (in the link href) you wish.

    Of course, the .htaccess above is not what you would actually use (you will need to make sure requests for CSS, javascript and images all get through).

  • #11
    Regular Coder
    Join Date
    Jul 2010
    Posts
    185
    Thanks
    3
    Thanked 42 Times in 42 Posts
    Man, I really should have checked the date on this thread.
    Don't know why it popped up to the first page.
    (Also, not relevent to PHP).

    Here's hoping it sinks back down to wherever it came from.

    Sorry folks. Nothing to see here.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •