Forum Moderators: phranque

Message Too Old, No Replies

Autoincremented primary db key as URL parameter

Do you do it? Is it advisable?

         

andreasfriedrich

11:53 pm on Sep 28, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would think not. Despite it helping to speed up your queries it will also help people to leech your whole database by just looping through all your primary keys.

Comments are most welcome.

Andreas

Grumpus

12:24 am on Sep 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use them, but at times I wish I did it my name so I could have gotten a few keywords into the URL. (But, then I get to thinking about length of URL's and I'm glad I used the primary key number).

And, as far as just scanning through the primary keys, that won't work as soon as you delete one entry in the database.

Then again, if Googlebot or another spider can go through and index your site, so can any leech software, so it doesn't matter what you use as far as making it tough to leech.

G.

jatar_k

6:57 am on Sep 29, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Grumpus has a good point. If they want to leech your site they will do it. We can make it difficult for them but I doubt we can stop it if they are bound and determined.

I don't really see anything wrong with it, though I wouldn't have a get string that said primary_key=x. Most strings have id but you really never know what it is. I don't often use this method, I try to post it or store it etc, to keep away from get strings all together.

Nick_W

7:09 am on Sep 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do it all the time. I think it's a nice clean way to have articles/news databases on a site. My url's generally look like this:
www.site.com/articles/23/

Sure there are no KW's in the url but it's nice and spiderable, not to lenghthy and the fact that it appears to be lower in the hirachy does not affect PR. Linking affects PR, so if you have your latest 10 articles linked from your home page it's just the same as if they were in the root dir.

Nick

andreasfriedrich

12:22 pm on Sep 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your comments.

I didnīt imagine that by avoiding the primary key the leeching would be impossible. Itīs just that everybody can hack together a script which requests acco_x.html for 0 < x < 10000 whereas it would require a lot of more work to make a real spider to access all your records.

Andreas