SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Query String Syntax

    If I want to scrap my "Pretty URL" - for SEO reasons - and add a Query String to a URL instead, which of these would be the correct format...

    Before:
    Code:
    www.debbie.com/finance/economy/by-date/desc/3

    Proposed:

    Section = "Finance", Subsection = "Economy"
    Code:
    1.) www.debbie.com/finance/economy/3&sortname=by-date&sortdir=desc  (From ScallioXTX here...)
    
    2.) www.debbie.com/finance/economy/?3&sortname=by-date&sortdir=desc
    
    3.) www.debbie.com/finance/economy?3&sortname=by-date&sortdir=desc
    
    4.) www.debbie.com/finance/economy/?page=3&sortname=by-date&sortdir=desc
    
    5.) www.debbie.com/finance/economy?page=3&sortname=by-date&sortdir=desc
    
    6.) Other??
    Sincerely,


    Debbie

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,277
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    My vote is for #5.
    "First make it work. Then make it better."

  3. #3
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    My vote is for #5.
    Why do you say #5?


    I would have voted for #4...
    Code:
    4.) www.debbie.com/finance/economy/?page=3&sortname=by-date&sortdir=desc
    ...because it follows the "directories end with a / and files and webpages end with nothing" convention that seems pretty well-established.


    Would #4 even work as far as my mod_rewrite?


    Off Topic:


    I can't even believe I'm considering taking the plunge and breaking my beautiful mod_rewrite for all of this SEO crap?!

    But, @ScallioXTX ; does seem to have some valid points, so I'm trying to come up with the best solution possible...


    Sincerely,


    Debbie

  4. #4
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,277
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    Why do you say #5?
    I think page, sortname and sortdir work better as query string values rather than path segments because 1) they're all optional, and 2) their order doesn't matter.

    Quote Originally Posted by DoubleDee View Post
    I would have voted for #4...
    Code:
    4.) www.debbie.com/finance/economy/?page=3&sortname=by-date&sortdir=desc
    ...because it follows the "directories end with a / and files and webpages end with nothing" convention that seems pretty well-established.
    None of these are actual directories, thought, correct? There's no such thing as finance/economy/index.php. But rather, finance/economy is itself the resource location. Keeping a trailing slash just for the illusion of a directory seems like unnecessary cruft to me.

    Quote Originally Posted by DoubleDee View Post
    Would #4 even work as far as my mod_rewrite?
    Your rewrite would likely have to change. But it'll probably work out better this way. You won't have to worry about naming collisions between sort names such as "by-date" and article slugs.
    "First make it work. Then make it better."

  5. #5
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    I think page, sortname and sortdir work better as query string values rather than path segments because 1) they're all optional, and 2) their order doesn't matter.
    Okay.


    Quote Originally Posted by Jeff Mott View Post
    None of these are actual directories, thought, correct? There's no such thing as finance/economy/index.php. But rather, finance/economy is itself the resource location.
    Oh, okay, good point!


    Quote Originally Posted by Jeff Mott View Post
    Keeping a trailing slash just for the illusion of a directory seems like unnecessary cruft to me.
    Okay.


    Quote Originally Posted by Jeff Mott View Post
    Your rewrite would likely have to change. But it'll probably work out better this way. You won't have to worry about naming collisions between sort names such as "by-date" and article slugs.
    Are you saying this for either #4 (my preference) or #5 (your preference)?

    Or just for #5?


    This whole thing has me freaked out and scared, but I want to push myself to think about things in different ways and come up with the *best* solution!

    Looks like I have A LOT of work ahead of me rewriting all of my mod_rewrite and PHP code. (Such a bummer, because I was really proud of that mod_rewrite you helped me perfect!!) *sigh*

    Sincerely,


    Debbie


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
  •