Welcome to WebmasterWorld Guest from 54.204.189.167

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Best way to implement non-numeric ids

     
4:29 am on Nov 21, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 29, 2003
posts: 123
votes: 0


This is a general question.

On past sites I have created, I have used numeric ids in urls and rewritten them with mod rewrite eg www.somesite.com/somepage.php?someid=4 would become www.somesite.com/somepage/4.html

This time I wanted to get rid of the numbers and I am not sure of the best way to do this.

I think I would like to use text ids eg www.somesite.com/somepage.php?someid=page_name and rewrite that. But would this make database access much slower?

Or is a rewritemap a better way?

I wondered if anyone had any experience of these sort of issues and could offer some advice.

Thanks

3:33 pm on Nov 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


If you have httpd.conf access, I would certainly recommend the RewriteMap approach if you need to rewrite from "text-string IDs" to numeric IDs. However, you could also just lookup the text-strings within your script, and so avoid the need for a RewriteMap. As long as your database is set up with lookup keys based on the page-name, the lookup time should not increase dramatically.

Jim