This topic has been closed for further discussion.
Administrator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 3167
I've been thanked 101 times.
Offline
Long ago, it was said that search engines didn't index URLs with querystrings in them.
Then, it became clear that SEs did index URLs with querystrings.
Then it was noted that SEs avoided URLs with session IDs in them, as these often get regenerated and a spider could get stuck in an infinite loop
Guidelines popped up, such that a question mark is fine, but:
Don't use the letters "id" in any of the variable names
Limit the number of variables to 3
Be consistent in the variable order.
Anyway, I've never had a problem with "dynamic" URLs, but I'm trying to convince a client that they're okay - and I'm not having much luck.
Most stuff I read says not to use them, and although I could re-write using .htaccess or similar, is there anything wrong (from an SEO point of view) with the following format:
[http://example.com/?Category/Details/forProduct/7]
?
Member
From: York, England
Registered: 2005-11-04
Posts: 714
I've been thanked 19 times.
Offline
I dont think so.
Your example: ?Category/Details/forProduct/7
looks rewritten anyway, why not just drop the ? out of the rewrite?
Query strings tend to contain a resource ID like so: whatever.php?category=43&article=271. changing that with rewrite to: whatever/category-43-seo/271-should-i-use-mod-rewrite-for-my-urls.html injects some keywords into the url, which is obviously better in 99.9% of circumstances.
If you can have keywords in the url like (your example): ?Category=Details&forProduct=7&title=the+best+blue+widgets+ever I dont think mod rewrite would benefit you that much in G and Y. Not enough to warrant the work you'd have to put in to do the rewrite anyway.
The biggest prob with modrewrite is that competitors can screw you over (use that in your persuasion).
For instance (my example): whatever/category-43-seo/271-should-i-use-mod-rewrite-for-my-urls.html would generally use a rewrite command similar to this (top of the head stuff):
Code:
RewriteRule ^whatever/category-([1-9]*)-(.*)/([1-9]*)-(.*)\.html$ /whatever.php?category=$1&article=$2
The obvious problems with this are that anyone could link to: whatever/category-43-ANYTHING/271-ANYTHING.html and the url would be indexed causing dupes. An unscrupulosi could spin links and create an infinite number of urls for the same page. It was a nasty bug in wordpress that wasn't dealt with for quite sometime, not sure if it ever has been dealt with actually.
You could use PHP to get round it. I use this method:
Get the actual page url:
Code: php
function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; }
then work out what URL we're expecting as $expectedUrl. Easy enough as it'll generally be the product name with an ID or whatever. Then use:
That'll lock down any rewritten urls if the boss makes you do it anyway.
OK, you could use rel=canonical, but it's always better to have them on the right page (No?).
Administrator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 3167
I've been thanked 101 times.
Offline
Well, griff - my example is not re-written.
I do not use apache, or IIS, I use nginx so there is no .htaccess. It's really easy to strip out the question mark in nginx but I'd rather leave re-writes alone to create a cross-platform application.
If my url is
[http://example.com/?Category/Details/forProduct/7]
then the principle I am using in PHP is
Code: php
$cmd = explode("/",$_SERVER['QUERY_STRING']); $action = $cmd[0]; $module = $cmd[1]; for($i=2;$i<count($cmd);$i+=2) { $GET[$cmd[$i]] = $i+1; } $a = new $action."_".$module;

| Never |


