Go Back   Pligg CMS Forum > Other > Suggestions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-22-2006, 11:00 AM
New Pligger
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Where digg gets it wrong, URLs and Archives

Heres my suggestion on what could help make a killer digg-clone.

First look at the typical Digg URL
http://digg.com/science/The_Science_...adly_invisible look how long that is, and Mr. Matt Cutts (from Google) has blogged about how you shouldn't use _ as a seperator because - is a much better seperator in the search engine's eyes.

My advice is to have urls like http://pliggsite/category/url-friendly-title remove words like a,an,the,and,or,of,for and hyphonate the rest.

Also a cool URL mod would be to have http://category.pliggsite.com/url-friendly-title
Reply With Quote
  #2 (permalink)  
Old 03-22-2006, 11:02 AM
New Pligger
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
An easy compromise

An easy compromise could be http://pliggsite.com/category/#/url-friendly-title
whire # is the article id number
Reply With Quote
  #3 (permalink)  
Old 03-22-2006, 01:30 PM
Casual Pligger
 
Join Date: Feb 2006
Posts: 67
Thanks: 2
Thanked 0 Times in 0 Posts
I pretty much agree with 1 thing you said, changing the _ into -. I've read about it as well.. so yea..
Reply With Quote
  #4 (permalink)  
Old 03-22-2006, 02:43 PM
3dKiller's Avatar
Constant Pligger
 
Join Date: Mar 2006
Location: Newport Beach
Posts: 142
Thanks: 24
Thanked 2 Times in 1 Post
I definately agree with the "-". Google does prefer the hyphen vs underscore.
Reply With Quote
  #5 (permalink)  
Old 03-22-2006, 04:55 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
Thanks: 235
Thanked 345 Times in 206 Posts
Ok, this will be an easy enough fix. I'll release a version with these friendly URL's soon.
__________________
- Ash
Reply With Quote
  #6 (permalink)  
Old 03-22-2006, 05:06 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
Thanks: 235
Thanked 345 Times in 206 Posts
ok, here is the current code (modified for "-" instead of "_")

// Replace spaces with underscores
$output = preg_replace("/\s/e" , "-" , $input);

// Remove non-word characters
$output = preg_replace("/\W/e" , "" , $output);

Can someone give me a hand with preg_replace to remove "a,an,the,and,or,of,for"?

thanks!
__________________
- Ash
Reply With Quote
  #7 (permalink)  
Old 03-22-2006, 07:07 PM
New Pligger
 
Join Date: Jan 2006
Location: Idaho
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Try this

//Remove common words
$output = preg_replace( '/(-a-|-an-|-the-|-and-|-or-|-of-|-for-)/i', '-', $output );

l8r,
Joe
Reply With Quote
  #8 (permalink)  
Old 03-23-2006, 06:28 AM
New Pligger
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by j0zf
$output = preg_replace( '/(-a-|-an-|-the-|-and-|-or-|-of-|-for-)/i', '-', $output );
But that's readable, everyone knows you should make them obscure

Code:
/-(an?d?|f?o(r|f)|the)-/i
Or it might be useful to call this before the hyphenation so:
Code:
/\b(an?d?|f?o(r|f)|the)\b/i
Reply With Quote
  #9 (permalink)  
Old 03-23-2006, 10:52 AM
Casual Pligger
 
Join Date: Feb 2006
Posts: 67
Thanks: 2
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by AshDigg
ok, here is the current code (modified for "-" instead of "_")

// Replace spaces with underscores
$output = preg_replace("/\s/e" , "-" , $input);

// Remove non-word characters
$output = preg_replace("/\W/e" , "" , $output);

Can someone give me a hand with preg_replace to remove "a,an,the,and,or,of,for"?

thanks!
I wonder if you could get rid of the '?' and have the category name included in the url?
Reply With Quote
  #10 (permalink)  
Old 03-24-2006, 08:56 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
Thanks: 235
Thanked 345 Times in 206 Posts
Thank you "j0zf" and "caomhin".

You can now see the results of this at http://ashtest1.pligg.com
__________________
- Ash
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Search Engine Friendly URLs by vBSEO 3.2.0