Quantcast

Named parameters VS $_GET

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Named parameters VS $_GET

tekomp

Are there any particular reasons to use named parameters in a URL
instead of a normal GET string?

/posts/view/var1:3/var2:4

VS

/posts/view/?var1=3&var2=4

Both can be accessed in $this->params.  I've always used a regular GET
string, but if Cake convention suggests not to, I'd be interested to
hear why.

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Named parameters VS $_GET

Rafael Bandeira aka rafaelbandeira3

Query strings are evil for seo. That's why.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Named parameters VS $_GET

Smelly Eddie

I think there is a little more to it than that.

Most search engines ignore anything after ? (query string)

This can be useful or detrimental depending on your situation.

If you are passing around trivial data like session ids or something
that doesn't physically alter the page, I would stick with query
strings. This prevents engines like Google from seeing 'duplicate'
content which lowers your page rank.

If you used
/posts/view/trivial:875783
Google would see each different number as a unique page, but notice
the exact same content.

If you use
/posts/view/?trivial=894894
Google will treat all as the base url -> /posts/view/, and only index
it as 1 page.




So if your passing in a search word, you might want to use named
variables since a search for cats should be very different that a
search for dogs.

If you passing in encrypted data or something that has no direct
impact on the pages content, you might instead choose query strings.



Hope that helps,
EW


On Nov 19, 4:55 am, Rafael Bandeira aka rafaelbandeira3
<[hidden email]> wrote:
> Query strings are evil for seo. That's why.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Named parameters VS $_GET

Rafael Bandeira aka rafaelbandeira3

Although I think you just specified and went deeper on what I roughly
said, I think you said it very well a very elegant explanation. 5
stars for you

On 20 nov, 15:29, Smelly_Eddie <[hidden email]> wrote:

> I think there is a little more to it than that.
>
> Most search engines ignore anything after ? (query string)
>
> This can be useful or detrimental depending on your situation.
>
> If you are passing around trivial data like session ids or something
> that doesn't physically alter the page, I would stick with query
> strings. This prevents engines like Google from seeing 'duplicate'
> content which lowers your page rank.
>
> If you used
> /posts/view/trivial:875783
> Google would see each different number as a unique page, but notice
> the exact same content.
>
> If you use
> /posts/view/?trivial=894894
> Google will treat all as the base url -> /posts/view/, and only index
> it as 1 page.
>
> So if your passing in a search word, you might want to use named
> variables since a search for cats should be very different that a
> search for dogs.
>
> If you passing in encrypted data or something that has no direct
> impact on the pages content, you might instead choose query strings.
>
> Hope that helps,
> EW
>
> On Nov 19, 4:55 am, Rafael Bandeira aka rafaelbandeira3
>
> <[hidden email]> wrote:
> > Query strings are evil for seo. That's why.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...