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:


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

Proposed:

Section = “Finance”, Subsection = “Economy”


1.) w[B][/B]ww.debbie.com/finance/economy/3&sortname=by-date&sortdir=desc  (From ScallioXTX [here](http://www.sitepoint.com/forums/showthread.php?1206682-Question-about-building-a-Pretty-URL&p=5657552&viewfull=1#post5657552)...)

2.) w[B][/B]ww.debbie.com/finance/economy/?3&sortname=by-date&sortdir=desc

3.) w[B][/B]ww.debbie.com/finance/economy?3&sortname=by-date&sortdir=desc

4.) w[B][/B]ww.debbie.com/finance/economy/?page=3&sortname=by-date&sortdir=desc

5.) w[B][/B]ww.debbie.com/finance/economy?page=3&sortname=by-date&sortdir=desc

6.) Other??

Sincerely,

Debbie

My vote is for #5.

Why do you say #5?

I would have voted for #4


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?! :rolleyes:

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

Sincerely,

Debbie

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.

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.

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.

Okay.

Oh, okay, good point!

Okay.

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