Forum Moderators: open

Message Too Old, No Replies

ASPX - SEO friendly URL with database id

         

jaffstar

12:58 pm on Aug 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We are trying to get URL's for a site SEO friendly and keyword rich. The developers have managed to get keyword in the URL but also have included a unique reference in database reference in the url so its unique.

If we look at the apache world, we can create url's without this. Can this be done on aspx ?

pageoneresults

1:41 pm on Aug 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If we look at the Apache world, we can create urls without this. Can this be done on aspx?


Yes, it can. If you're running a later version of IIS (7+), there are utilities available for handling most of the basics. But, we've tried that route and it is nowhere near as configurable as ISAPI_Rewrite. We use version 3 and a .htaccess file just like those on Apache. We can do just about everything those "other" folks can do. ;)

marcel

1:47 pm on Aug 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is possible, the way I have done it in the past is to create a new unique varchar field in the table containing the keyword-rich string (slug) you want in the URL. You can quite easily create a unique 'slug' for each page, and search for this instead of the Id.

For example, your URL's may look something like this at the moment:

/how-to-drive-a-car/587/

The number 587 corresponds to the Id in the table, but you could also do the following:

/how-to-drive-a-car/

And instead of searching for the Id, you search for the 'slug' in the DB.

phranque

10:07 am on Aug 16, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



in marcel's example you should be sure to serve a 200 status code for only one of those urls, which is the canonical url.
the other url must 301 redirect to the canonical url.

jaffstar

2:23 pm on Aug 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The developer has this concern:

Also, there will be an issue where there is possibly a conflict as the pages are dynamically createad and certain characters aren’t allowed in the URL – so a product could come with a strange character and the page would result in an error which we wouldn’t know about until someone reported it to us


The site sells various products and the above issue is what everyone is worried about. Any suggestions on this ?

mattglet

10:17 pm on Aug 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The developer should be savvy enough to create functionality (a RegEx) which can make so only allowed characters will appear in the URL. Either your developer is lazy or didn't immediately think of this.

jaffstar

4:46 am on Aug 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Appreciate the comments. I will follow-up.

marcel

7:15 am on Aug 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...and certain characters aren’t allowed in the URL...

That's why I mentioned a 'slug' a few times. A quick search on creating a slug should get the developer on track.