SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 49
  1. #1
    ********* Articles ArticleBot's Avatar
    Join Date
    Apr 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Article Discussion

    This is an article discussion thread for discussing the SitePoint article, "Search Engine-Friendly URLs"

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,426
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    This article is old but still very relevant. Implementing what I learned in this article has had a profound impact on my websites. To score it a 10 would be to under-rate its value.

  3. #3
    SitePoint Zealot mrWoot's Avatar
    Join Date
    Jan 2004
    Location
    Wisconsin
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I used it when I converted everything from ASP to PHP. VERY useful. 10/10

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    IMHO, Chris Beasley missed the best solution (and gets, at best, a 6/10 for his effort).

    Sitepoint's Apache forum has MANY good threads on using Apache's mod_rewrite module in the .htaccess file. With this, I've just completed transitioning from a series of $_GET style URLs to Search Engine Optimized pages (i.e., the http://www.domainname.com/article/## displays the /viewfullarticle?id=## script). There were some knotty things to work out but I believe this is far superior to Chris's path_info, Error Pages and ForceType. Anyone interested in SEO should have a read of Chris's article then have a search through the Apache forum for mod_rewrite (online documentation on mod-rewrite is terrible -- that forum has provided the best information I've found).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    earth
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Prefer mod_rewrite here as well.

  6. #6
    SitePoint Member
    Join Date
    Aug 2004
    Location
    Illinois, USA
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    forcetype application

    Have used this and prefer it, however it appears busted in http 2.0

    www.site.com/script involkes the (or even a script with symlinks
    enabled to script.php but

    www.site.com/script/parms doesn't even get envolked anymore ?

    Was using
    <location
    which maybe should have/be
    <file

    but neither works now.

    Any suggestions?

  7. #7
    SitePoint Member
    Join Date
    Aug 2004
    Location
    Illinois, USA
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by siliconsorcerer
    Have used this and prefer it, however it appears busted in http 2.0

    www.site.com/script involkes the (or even a script with symlinks
    enabled to script.php but

    www.site.com/script/parms doesn't even get envolked anymore ?

    Was using
    <location
    which maybe should have/be
    <file

    but neither works now.

    Any suggestions?
    Oh man nothing like being a dope....
    Looks like AcceptPathInfo on is the answer.

  8. #8
    SitePoint Member
    Join Date
    Aug 2004
    Location
    93402
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fircetype Solution Seems Incompatible with Web Log Tools

    I've used the Forcetype solution, and have become aware that Web Log tools (e.g., LiveStats) can not report page activity, because none of my URLs end in file extensions.

    Any advice?

  9. #9
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good article, and to confirm it's usefulness doing a search for 'article 485' on google will give this article as the first result :)

  10. #10
    Saidan Ryuuza
    SitePoint Community Guest
    None of these methods work for me, the apache "look back" feature doesnt work on three different servers, what am i doing wrong?

    thanks

    email:webmaster@therandomjoe.com
    ICQ: 165512867 (prefered)
    AIM: sryuuza
    MSN: sryuuza@msn.com

  11. #11
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the only thing missing in this article is what the links should become! as a novice i struggled as the links kept altering. other then that seems to work fine. any one got any tips how to add security to these methods?

  12. #12
    bob
    SitePoint Community Guest
    Your forgot a big drawback:
    $_GET and $_POST will be ignored with redirections!

  13. #13
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not explain the method of mod_rewrite with apache?

  14. #14
    Ivan
    SitePoint Community Guest
    Is there a way to use any one of those methods on a IIS server?

  15. #15
    SitePoint Enthusiast gesf's Avatar
    Join Date
    Oct 2004
    Location
    Portugal
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is Ivan! Called IISRewrite.
    However you can easily make that (php only) methods with ASP... if that's your case.

  16. #16
    SitePoint Member
    Join Date
    May 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this even nessesary anymore?
    Don't most search engines index and follow the whole URL anyway now?

    I do agree that the url looks cleaner, but to go through the trouble of reqwritting what i have, am i going to get a noticeable impovement in ranking?

    thanks.

  17. #17
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,804
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    You should notice an improvement in SE rankings but also bear in mind your visitors.
    It is far easier to type www.mydomain.com/site than www.mydomain.com/site/id=1&template=id...... etc
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  18. #18
    Malambo
    SitePoint Community Guest
    If the site is designed with ease of navigation in mind, the user won't need to type the URL anyway. Optimally, visitors should be able to get to an in depth article within three clicks from the home page.

  19. #19
    Ultrapasty
    SitePoint Community Guest
    Still, if possible it's probably better to stay on the safe side ;) I think that's the route I'll be taking!

    Thanks for this article, I found it really useful.

  20. #20
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Minnesota, USA
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just wanted to comment on two things:

    1.) Seriously, if you are making some sort of dictionary or resource website that is based around searches, allow the user to type in http://example.org/query_here. I must say, that is the most annoying part of Wikipedia for me. Let me type it in myself! I wish dictionary.com would do that also. PHP.net does it wonderfully, just go to php.net/include, and the include() function reference page pops up!

    2.) Some people might want to head over to drupal.org and look at their .htaccess file. They used an interesting technique for achieving URLs like this. They basically have everything after the domain name and slash rewritten to ?q=. Therefore, you could type http://example.org/article/215, and explode() the / out of there, call the article function, and then fetch the id 215. Or you could have pages like http://example.org/aboutus and http://example.org/donate without having to create files for all of them (as in the 3rd method mentioned above).

  21. #21
    Steve
    SitePoint Community Guest
    There is a drawback to these types of URL... Yahoo sucks... Yahoo likes to drop the last traing slash and then concatenate directories - using the above examples, a request from Slurp might be

    /article/999/12article/999/article12/999

    It sounds crazy I know, but I have spent weeks trying to "retrain" Slurp because of this exact problem, only to find it dropping the trailing slash on the retrained URLs

    A further complication is that Slurp makes up queries for example /article/?id=123, where the id 123 does not exist in any way on your site.

    So much fun :(

  22. #22
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my personal experience the mod_rewrite works far better than the other options. I originally used an error page to parse the variables from the names of html files similar to the way you described however occasionally IE had problems and would display its own 404 page. So I settled into using mod_rewrite.
    Originally I tried using a directory structure for the rewrites but it was causing trouble with my relative links, so I decided to use the name of a html file to pass the variables the same way as I did in the error method. This way there would be no hanging directories which make it obvious variables are being passed and it left the pages with easy to remember names.

    If anyone is interested I used the following rewrite rule:
    RewriteBase /
    RewriteRule ^([a-zA-Z]+).html$ index.php?mode=$1

    This way my entire website appears to be a bunch of static pages while giving me the ease of using a single file.

  23. #23
    SitePoint Member
    Join Date
    Oct 2004
    Location
    Mumbai
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just wondering why Sitepoint chose PATH_INFO method over mod_rewrite. Is there any specific reason for this decision?

  24. #24
    Hector
    SitePoint Community Guest
    Thank you for the ideas. The ForceType Directive method works great for my site. I was able to nest the script and now I'll never need to use those silly ?'s in the URL's again.

    The only problem I encountered was the first value of the array. In your example,

    $var_array = explode("/",$PATH_INFO);

    produces:

    $var_array[0] = "article.php"

    $var_array[1] = 999

    $var_array[2] = 12

    But when I ran the same code on my server, $var_array[0] always returned blank. It's not a problem, just curious as to why this could be happening.

    Thanks again!

  25. #25
    a8
    SitePoint Community Guest
    maybe your server disable register global


Bookmarks

Posting Permissions

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