Forum Moderators: open
We all know that sessionids suck.
But is a smaller variable name preferable to a long one, iow, "s=" is better than "sitenumber="?
Is one variable better than two?
i.e.
"sitenumber=5"
is better than
"action=sitenumber&sitenumber=5"
?
But still, if your using them the wrong way you will get in trouble sooner or later.? QUERY strings are jsut taht, QUERIES. if you use them to simply identify pages to pick you are ABUSING and should look into either server side URL modification (mod_rewrite) or at least use PATH_INFO instead like this:
domain.tld/scriptname/var1-val1/var2-val2/var3-val3 and so on...
Use the tools how they were intended and you are less likely to be misunderstood by others (i.e. Google)
SN
I think if you have real content and want to make the url more friendly to google (like by removing sessionid info from the url), you are neither hurting google, nor your web page visitors, nor is it abuse. But I'm not really sure what you mean.
What I mean is, that query strigns were created for a specific purpose. And it wasn't to pick on page out of a set of pages that a script can display (like a product catalog). Rather it's to actually query a database, like for a search result, in a way that can throw a different result each time.
For selecting pages (like from a product catalog) it's better to use PATH_INFO or mod_rewrite. Please do a site search for those, to see the millions of threads on the topic. Also search for "Cool URIs don't change" on Google, it's a very enlightening article by the W3C.
SN
Also Google doesn't always crawl all dynamic content (any page with a?) - it depends on the size of your site an your PR (apparantly). But I have a PR5 site with 20 pages like this and Google has crawled all of them just fine.
That's what I mean by "abuse". 95% of modern dynamic pages use QUERY_STRING for the purpose that PATH_INFO was invented for. As the W3C recommendations say (and may I remind you that they're the ones who come up with the standards), QUERY_STRING is for ephemerial information that is NOT well defined by the URL + QUERY_STRING. A modern dynamic website delivers content pages (plus perhaps some minute dynamic info). The dynamic part comes really just form the fact that the content is loaded and combined on the fly, NOT that the content is unique to this request.
I'm not preaching rules and regulations, I'm merely promoting best practices, in the hope that one day the internet will be what it can be.
SN
I've used both Mod Rewrite (which I hate, because it is often unpredictable and doesn't work the way it is supposed to) as well as the querystring with great success on Google. Lots of dynamic content spidered.
But I don't like the idea of presenting different content for google and for the web visitor (unless it uses xml and the like in the manner it was built for...but google does not do that today). If the web visitor consistently visits domain.com?page=1, because page=1 is something generated by a database, it would be nice for google to follow the same link, along with the requisite PR, Anchor Link text values and other google ranking data that link deserves.
By using Mod Rewrite to duplicate the page, I'm not sure it really makes the internet a better place... Anyways, that's all semantics...I don't have time for Utopia anyways, unfortunately, it's about practicality.
The purpose of the thread was to find out what works because those longer queries aren't working as well for me so I will be try reducing the length of the url. Thanks sullen!
Apart from that, I also recommend using hashed urls to prevent ppl from fiddling around with the parameters.
But take care that pages with different hashed-urls dont reference the same content, otherwise you will get duplicate content.
which do you like better? is the former hard to do? NO! Do you need to use mod_rewrite? hardly. In fact if you hate it so much, simply create ONE rule that pumps ALL urls into ONE script like>
domain.tld/content1 --> domain.tld/script/content1
I used that method for many HUGE sites, where the one script then figures yout the real URL. no mod_rewrite rules for all pages, and you can do with your URLs whatEVER you want. Even dynamic .js and .css files... The posibilities are endless...
Please donT' think me a nut case, I wouldn'T recommend this stuff if it wasn'T any good ;)
SN
Sorry, if it sounded like I was being antagonistic to you, that wasn't how I meant it. I respect you, you seem to be pretty knowledgeable...
I guess I misunderstood PATH_INFO...are you saying that Path info does not use Mod ReWrite. I dunno, I keep learning more and always feel like I know nothing...
Hashed urls? Another one I don't get..