It looks like your current URL paths are of the form /category/redundant-descriptive-title/id
, where only the category
and id
parts are actually needed to identify the content. (For example, I can link to http://www.soundplaza.co.uk/speakers/blah-blah-who-reads-this-anyway/10 and see the exact same content as on the page you linked in your question.)
I would suggest changing that structure to /category/id/redundant-descriptive-title
, so that the descriptive part of the URL is the last one. (If that looks familiar to you, it's the exact same URL structure as used by the StackExchange software.)
That order has a natural hierarchical structure: the first part identifies the category, the second identifies the product in the category, and the third... doesn't actually identify anything in this case, since it's redundant to the first two, but conceptually it could narrow down the identification even further.
I would also strongly suggest setting up either 301 redirects or rel=canonical
links from URLs with incorrect (and/or outdated) descriptive parts to the correct canonical URLs for each product. If you don't do that, any links with outdated or mistyped or just plain bogus titles, like the one I demonstrated above, may be seen by search engines as duplicate content.
(Ps. Swapping the order of the URL path elements around like that might make dealing with legacy links a bit tricky, but I'd really consider that an excellent reason to do it ASAP rather than later. As long as none of your existing URLs have all-numeric middle parts, something like the following rewrite rule ought to redirect them to the new format:
RewriteRule ^/?([^/]+)/([0-9]*[^/0-9][^/]*)/([0-9]+)$ /$1/$3/$2 [NS,L,R=301]
Of course, you may want to adjust that regexp — especially the category part — to match your existing URLs structure more strictly.)
Edit: Per comments below, I might set up the rewrite rules something like this:
RewriteEngine On
RewriteBase /
# 301 redirect from speakers/title/id to speakers/id/title
RewriteRule ^speakers/([0-9]*[^/0-9][^/]*)/([0-9]+)$ /speakers/$2/$1 [NS,L,R=301]
# Internally rewrite speakers/id/title to details.php
RewriteRule ^speakers/([0-9]+)/(.*)$ details.php?dealID=$1&name=$2 [NS]
I left out the [L]
from the second rule, since it probably doesn't do what you expect when used with internal rewrites in an .htaccess
file. If you really want to skip all later rewrite rules, use [END]
instead.
As noted above, I would also recommend making details.php
either:
include a rel=canonical
link pointing to the correct http://www.soundplaza.co.uk/speakers/id/title
URL for the item in the HTML <head>
section, and/or
compare the title passed in via the name
parameter to the title the product is supposed to have, and, if they don't match, return a 301 redirect to the correct canonical URL.
In fact, I'd suggest doing both: there are various corner cases that each of these techniques will handle that the other might not.