View Full Version : Mod Rewrite Question


byronshell
02-24-2006, 06:25 AM
I am working with a developer who is performing a mod rewrite. My question is which is the better way to handle the following url? Or is their a better way than what is listed.


Should I change the links so that it directly links to /cat/150/ or should I leave it as ?cat_id=150 and allow the mod-rewrite to worry about changing it?

Paz
02-24-2006, 09:19 AM
Hi,

just about anything's possible with a mod rewrite. The norm would be to convert:

http://www.danforthdiamond.com/jewelry/bracelets/?cat_id=150

to

http://www.danforthdiamond.com/jewelry/bracelets/150.html

Cheers,
Paz.

RyanSmith
02-24-2006, 10:02 AM
I'm personally a big fan of using friendly names for my URL rewrites. I know that the SE's don't put too much emphasis on the keywords in the URL (but I know sometimes they count), but I just think it looks nicer. Instead of having something like cat_id=150, I would make an extra field in the database called friendly that maps the 150 to a name describing the product. You have to make sure you keep them unique and remove any special characters, but it's pretty easy with a regular expression.

blogmaster2003
02-25-2006, 10:55 AM
Hi, i need to ask something related to this subject:

I have to have the site in this dir:

www.ezbbforum.com/site

then the pages are

www.ezbbforum.com/site/index.php?option=com_content&task=view&id=13&Itemid=2

i use a mod for joomla (open sef) where i rewrited that url to

www.ezbbforum.com/site/easy-free-forum.html

Can i be penalized by SE´s for foing this? Or did i do something GOOD?

PS: i try!!! to do seo for free forum :)

dcz
06-19-2006, 03:34 PM
I personally prefer to keep numerical IDs in the Reg-Ex, it's less work for them and for the SQL part too.

And you don't care about duplicate titles even though we should all avoid them, sometime a static term for general discussion is a good thing, at lest IMHO.

So for the first example I 'd either go for :


http://www.danforthdiamond.com/jewe...celets/cat/150/

or

http://www.danforthdiamond.com/jewe...celets-c150/

or even

http://www.danforthdiamond.com/jewe...celets-c150.html


++

RyanSmith
06-19-2006, 06:04 PM
The problem with leaving the numeric in the URL is ususally that's a Unique Identifier. If you ever decided to change your arcitecture, then all these ID's will be incorrect. Now they are useless junk in the URL.

I perfer to do a "Friendly Name" that corrosponds to the unique identifier. This way if I ever need to change my sites functionality, I can maintain all those URLs.

dcz
06-20-2006, 12:32 AM
True, but this changes when you have to deal with many thousand of topics, the ID can be important fo performances in SELECTs.

And HTTP 301 is watching our backs ;)


if ... not good => good :D

++