View Single Post
  #1 (permalink)  
Old 02-02-2008, 08:22 AM
mendim mendim is offline
New Pligger
 
Join Date: Jan 2008
Posts: 12
Thanks: 2
Thanked 6 Times in 2 Posts
Pligg Google SEO Friendly URL Rewrite Hack

A default Pligg story URL once rewritten looks like the example below.

PHP Code:

http
://www.designfloat.com/General/Joshua_Glenn_Taking_Things_Seriously/ 
What stands out is the use of _ Underscores within the URL, Google prefers the use of a hyphen/dash - as a separator and for more information on this read the Blog post by Matt Cutt’s who works for Google. This excerpt below taken from Matt’s blog post should indicate exactly why a hyphen/dash is a better separator. Visit Matt's Blog

Matt Cutts wrote:
With underscores, Google’s programmer roots are showing. Lots of computer programming languages have stuff like _MAXINT, which may be different than MAXINT. So if you have a url like word1_word2, Google will only return that page if the user searches for word1_word2 (which almost never happens). If you have a url like word1-word2, that page can be returned for the searches word1, word2, and even “word1 word2″.

So how do we fix this? luckily Adam over at Pligg Template has provided some code to clean up the Pligg URL system to be more Search Engine Friendly. We will use some of that code to achieve a nice clean URL system like below.



PHP Code:
http://www.designfloat.com/general/joshua-glenn-taking-things-seriously/ 
Open
PHP Code:
libs/utils.php and FIND 

PHP Code:
$output utf8_substr($input0240); 
REPLACE WITH


PHP Code:
$output utf8_strtolower($input0240); 
PHP Code:
libs/utils.php 
and FIND

PHP Code:
$output str_replace("\""""$output); 
REPLACE WITH

PHP Code:
$output str_replace(" - ""-"$output);
$output str_replace("_""-"$output);
$output str_replace("---""-"$output);
$output str_replace("\""""$output);
$output str_replace("--""-"$output); 
Now you have lovely clean and Google friendly URL’s note for categories you must manually create categories in lowercase from the Admin section of pligg or your htaccess won’t work. Also this change should not be applied to an existing site unless you know how to 310 redirect content that is currently indexed under the old url system or you have a very small site with very little indexed story content.

i found this
Reply With Quote