Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 401

PostPosted: Thu Mar 20, 2008 8:01 am Reply with quote

Hardly an original or thought provoking subject line but it's the best I could muster.
I'm tweaking a 'reviews' script at the moment in which the original author has bult in some SEO technique to shorten the url.
I'm not in agreement with his methodolgy and in fact, the url yoursite.com/2/2.php really doesn't float my boat at all!
His methodolgy is merely shortening the uri to the shortest permissible number of characters and that alone has no worth for SEO to my way of thinking.

Luckily I can access a $var which contains the subject 'title' of the reviewed 'item' so it is a simple matter to inject the textual value of the $var into the uri so that links on the page could be indexed with 'subject' lin as part of the link.

However, because the var will either contain whitespace or %20 between words I'm not entirely sure of the best way to convert those instances to hyphens. Should I use a simple str_replace or something else?

I cannot use htaccess directives because that would have no effect on what is actually 'on page' as far as url links are concerned and I do NOT want spiders picking up links with spaces or %20 in them as that would look terrible!
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Thu Mar 20, 2008 9:23 pm Reply with quote

Yeah, I know what you mean. What you might consider doing is using preg_replace with an array of FROM and array of TO values. preg_replace will walk through the two arrays in sequence doing the search and replace on the entire target string.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Thu Mar 20, 2008 9:23 pm Reply with quote

Yeah, I know what you mean. What you might consider doing is using preg_replace with an array of FROM and array of TO values. preg_replace will walk through the two arrays in sequence doing the search and replace on the entire target string.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 401

PostPosted: Fri Mar 21, 2008 2:22 am Reply with quote

Thanks for that I'll look into it.
I need to re-factor the whole link building method he is using as making a url with
2/2/.php
just seems so completely wrong. htaccess should be used to make the link 'better' but not to make the link 'work' because it is formatted incorrectly 'on page'. If you cannot use htaccess then at the moment it means you cannot use the script.

With hindsight, I went public with the site too early so I have had to acquire another license for a seperate intsall in order to make what I think will be improvements.

Thanks again M, I know you are busy Smile
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1391

PostPosted: Sat Mar 22, 2008 12:45 pm Reply with quote

I agree with you. There is not difference SEO or even visual-wise between:

http://somedomain.tld/content-1-2.html

and

http://somedomain.tld/1/2/content.html

However, the following would be much, much better:

http://somedomain.tld/content/fishing/2/how-to-catch-bass.html

There are even variations on this that would be just as nice.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 401

PostPosted: Sat Mar 22, 2008 4:03 pm Reply with quote

Agreed Smile
I'll be using the same DB data for my experimental site so when I'm ready, I'll send you a link so you can see the differences.
I wanted to get stuck into this at the weekend but I have been doing a 5 hour drive to Krakow most days (wifes Dad and his g/friend are visiting) and I have decided to develop this gallery module instead as it has been a blast of fun.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch