Google Optimization
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsGoogleGoogle Optimization

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old September 6th, 2008, 08:44 AM
Joppiesaus Joppiesaus is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 41 Joppiesaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 1 m 45 sec
Reputation Power: 1
URL rewriting (?)

Hello,

To make my upcoming website seo friendly I want to implement some URL rewriting (I guess, if someone knows a better solution to the following please let me know).

The website is a webshop with a lot of different products. The website is in php so normally I would write my product pages something like this:

mysitedotcom/product.php?ID=100&Categorie=Hat&Subcategorie=Red%20Hat&Name=Superflex%20Red%20Hat

All the information for the different Categorie, Subcategorie and Name would be pulled from a MYSQL database. What I want to do is make the URL like this:

mysitedotcom/Hat/Red-Hat/Superflex-Red-Hat.html

So what I need is:
- PHP must become .HTML
- Database fields must be used to make a "tree" in the URL (--> /.../...)
- ID should not be visible because this doesn't say anything about the product
- I want "- " implemented for spaces so that the internet explorer doen't give the standard "%20"

How do I do this? Also, I do not want to link from one page to "mysitedotcom/product.php?ID=100&Categorie=Hat&Subcategorie=Red%20Hat&Name=Superflex%20Red%20Hat" where it rewrites to "mysitedotcom/Hat/Red-Hat/Superflex-Red-Hat.html" on that page. In fact, I don't want this contruction (mysitedotcom/product.php?ID=100&Categorie=Hat&Subcategorie=Red%20Hat&Name=Superflex%20Red%20Hat) visible anywhere in my website code for Google to see.

How do I pull this off and can this be done using Dreamweaver. I guess this is quite a request, if u need more info, please let me know. I do know a website who does this very well (www dot klara dot nl !!! not so suitable for work however) They do this in not only their productpages, but also their category and subcategory pages, which is exactly what I want to do.

Many thanks in advance!

Reply With Quote
  #2  
Old September 6th, 2008, 10:01 AM
s1974lee's Avatar
s1974lee s1974lee is offline
Black Panther
SEO Chat Newbie (0 - 499 posts)
 
Join Date: May 2006
Location: Leeds
Posts: 62 s1974lee User rank is Just a Lowly Private (1 - 20 Reputation Level)  Folding Points: 16228 Folding Title: Novice Folder
Time spent in forums: 1 Day 4 h 29 m 49 sec
Reputation Power: 3
Send a message via Google Talk to s1974lee Send a message via Skype to s1974lee
Here is a useful toolto help you http://www.seochat.com/seo-tools/url-rewriting/
__________________
Just 'Chroming' the Web



Market Defender

Reply With Quote
  #3  
Old September 6th, 2008, 11:32 AM
ssandecki's Avatar
ssandecki ssandecki is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Location: Chicago, IL
Posts: 120 ssandecki User rank is Corporal (100 - 500 Reputation Level)ssandecki User rank is Corporal (100 - 500 Reputation Level)ssandecki User rank is Corporal (100 - 500 Reputation Level)ssandecki User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 9 h 21 m 42 sec
Reputation Power: 3
Send a message via MSN to ssandecki
This will require "alot" a work most likely, and require editing of your webshops backend. Here is an idea, you should search your webshops website to see if any mods\addons exist already to create SEO friendly URLs, if not you might want to hire a freelance to do this work for you, I highly doubt anyone will go beyond linking you to apache url modding resources.

Reply With Quote
  #4  
Old September 6th, 2008, 11:52 AM
Joppiesaus Joppiesaus is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 41 Joppiesaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 1 m 45 sec
Reputation Power: 1
Quote:
Originally Posted by ssandecki
This will require "alot" a work most likely, and require editing of your webshops backend. Here is an idea, you should search your webshops website to see if any mods\addons exist already to create SEO friendly URLs, if not you might want to hire a freelance to do this work for you, I highly doubt anyone will go beyond linking you to apache url modding resources.


The thing is that this website still needs to be build and I want to do it right the first time. So, I can really still do anything.... I'll have a look around, but if anyone here has some experience or really solid suggestions I would love to hear them.

kind regards.

Reply With Quote
  #5  
Old September 6th, 2008, 12:23 PM
ssandecki's Avatar
ssandecki ssandecki is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Location: Chicago, IL
Posts: 120 ssandecki User rank is Corporal (100 - 500 Reputation Level)ssandecki User rank is Corporal (100 - 500 Reputation Level)ssandecki User rank is Corporal (100 - 500 Reputation Level)ssandecki User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 9 h 21 m 42 sec
Reputation Power: 3
Send a message via MSN to ssandecki
Quote:
Originally Posted by Joppiesaus
The thing is that this website still needs to be build and I want to do it right the first time. So, I can really still do anything.... I'll have a look around, but if anyone here has some experience or really solid suggestions I would love to hear them.

kind regards.


I would take a look at ZenCart and OSCommerce then for your backend.

Reply With Quote
  #6  
Old September 6th, 2008, 02:46 PM
abercrombie abercrombie is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 3 abercrombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 40 sec
Reputation Power: 0
depending on what software you use for your website, i would suggest looking for any SEO plugins. most major php software suites have SEO modifications or plugins. doing this task yourself is daunting.

Reply With Quote
  #7  
Old September 7th, 2008, 07:48 AM
Joppiesaus Joppiesaus is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 41 Joppiesaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 1 m 45 sec
Reputation Power: 1
Quote:
Originally Posted by abercrombie
depending on what software you use for your website, i would suggest looking for any SEO plugins. most major php software suites have SEO modifications or plugins. doing this task yourself is daunting.


I agree, I have thought about the things I would need to do to implement this troughout the site. The problem of rewriting the URL for product pages does not seem to be the biggest problem, however, I also want to link directly to the correct link obviously (so this isn't rewriting anymore is it?) and how on earth do websites like i mentioned get the right data for their product page? I always used a GET method where the product ID was in the URL, but this isn't possible using link building like this...

If anyone has experience making these websites and can tell me what the best software is for doing this job (prefferebly free software as I do not have a large amount of money to invest) please let me know.

If you could also tell me how the mechanics of websites like www dot klara dot nl work (NSFW!) (Sorry, is one of the only websites I know who really did the job well implementing good links) please let me know, I am VERY interested of implementing this idea the correct way when I start!

Thanks.

Reply With Quote
  #8  
Old September 7th, 2008, 11:49 AM
graphical_force's Avatar
graphical_force graphical_force is offline
Student of Life
SEO Chat Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 133 graphical_force User rank is Corporal (100 - 500 Reputation Level)graphical_force User rank is Corporal (100 - 500 Reputation Level)graphical_force User rank is Corporal (100 - 500 Reputation Level)graphical_force User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 13 h 21 m 2 sec
Reputation Power: 2
What you are talking about depends on what is the platform of your server. If you are using php it is most likely Apache (linux). If so, then you would use mod_rewrite. I was in the same situation for a IIS (windows) server and there are products for that that are different. Find out some info on your server first and post back.
__________________
A sig test:

castrol srf | Graphical Force

"When everybody is special . . . nobody will be." -Syndrome

Reply With Quote
  #9  
Old September 7th, 2008, 12:39 PM
Joppiesaus Joppiesaus is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 41 Joppiesaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 1 m 45 sec
Reputation Power: 1
Quote:
Originally Posted by graphical_force
What you are talking about depends on what is the platform of your server. If you are using php it is most likely Apache (linux). If so, then you would use mod_rewrite. I was in the same situation for a IIS (windows) server and there are products for that that are different. Find out some info on your server first and post back.


I am currently looking for a linux based server. However, I am very flexible on this one because I have worked on both in the past for small webshops. (So if windows is easier I could look at that as well..)

Reply With Quote
  #10  
Old September 7th, 2008, 01:27 PM
Joppiesaus Joppiesaus is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 41 Joppiesaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 1 m 45 sec
Reputation Power: 1
Quote:
Originally Posted by s1974lee
Here is a useful toolto help you http://www.seochat.com/seo-tools/url-rewriting/


Hi, Thanks for the tool, it seems quite handy, but doesn't this leave me with a lot of problems?

For instance, when I link page 1 to the dynamic page, doesnt the original link still apply on page 1? So wouldn't this be the case: on page 1 this link: mysite dot com/product.php?id=1&name=Example would link to the rewritten dynamic page mysite dot com/product/ID/1/Name/Example/ ????

If the 'linking URL' in the code would also be converted then this would help a lot.

Reply With Quote
  #11  
Old September 8th, 2008, 04:29 AM
s1974lee's Avatar
s1974lee s1974lee is offline
Black Panther
SEO Chat Newbie (0 - 499 posts)
 
Join Date: May 2006
Location: Leeds
Posts: 62 s1974lee User rank is Just a Lowly Private (1 - 20 Reputation Level)  Folding Points: 16228 Folding Title: Novice Folder
Time spent in forums: 1 Day 4 h 29 m 49 sec
Reputation Power: 3
Send a message via Google Talk to s1974lee Send a message via Skype to s1974lee
Quote:
Originally Posted by Joppiesaus
Hi, Thanks for the tool, it seems quite handy, but doesn't this leave me with a lot of problems?

For instance, when I link page 1 to the dynamic page, doesnt the original link still apply on page 1? So wouldn't this be the case: on page 1 this link: mysite dot com/product.php?id=1&name=Example would link to the rewritten dynamic page mysite dot com/product/ID/1/Name/Example/ ????

If the 'linking URL' in the code would also be converted then this would help a lot.


I would suggest using 301 redirects on your original URL's to your new URL's.

Reply With Quote
  #12  
Old September 8th, 2008, 09:36 AM
sksingh sksingh is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 sksingh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 38 m 16 sec
Reputation Power: 0
Hello Joppiesaus,

There is 2 way for URL Rewriting.

One is to using POST on the place of GET.

And another is by Apache URL Rewriting.

you can see it on this location:

httpddotapachedotorgslashdocsslash1dot3slashmiscsl ashrewriteguidedothtml

Reply With Quote
  #13  
Old September 8th, 2008, 10:22 AM
JagNet's Avatar
JagNet JagNet is online now
Smoke me a kipper...
Click here for more information. Click here for more information
 
Join Date: Aug 2007
Posts: 2,072 JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 2 h 57 m 4 sec
Reputation Power: 38
Implementing mod_rewrite in the manner you've suggested is involved, but taken step by step it shouldn't be that daunting.

First thing is to take a look at the .htaccess rules, eg.
Code:
RewriteRule ^/(.*)/(.*)/(.*)\.html$ /product.php?Categorie=$1&Subcategorie=$2&Name=$3


Here you can see that we pass 3 variables, split by forward slashes, to the script: Categorie, Subcategorie, and Name. As you've already mentioned, the ID variable is no longer present, so that rules out the ability to fetch the required product from the database according to its ID number. Instead you need to look at what other variable you can use. In the case above that would be Name. It's still not ideal though, as in a larger shop there's plenty of opportunity to have more than one product with the same name. Secondly, you'd need to replace hyphens with spaces via php before calling the database, but what if the product name has hyphens in it? Too much possibility for error for my liking.

What to do then? My personal preference would be to introduce a new variable: Slug. This would be stored as a seperate, indexed column in the database, and would equate to the pseudo filename, avoiding any escaped characters. In your example URL ( /Hat/Red-Hat/Superflex-Red-Hat.html ), Slug would be "Superflex-Red-Hat".

So, instead of searching the database for $_GET['ID'], you'd be searching for $_GET['Slug'] (sanitizing the input of course).

The .htaccess code would then be something like:
Code:
RewriteRule ^/(.*)/(.*)/(.*)\.html$ /product.php?Categorie=$1&Subcategorie=$2&Slug=$3


Constructing the URL

The next step would be to create a function to construct the URL to maintain consistancy, eg

php Code:
Original - php Code
  1. function writeUrl($productSlug,$cat = false, $subCat = false) {
  2.   $url = '/';
  3.   if (!empty($cat)) {
  4.     $url .= $cat .'/';
  5.   }
  6.  
  7.   if (!empty($subCat)) {
  8.     $url .= $subCat .'/';
  9.   }
  10.   $url .= $productSlug . '.html';
  11.   return $url;
  12. }


So, in product category lists for example:
php Code:
Original - php Code
  1.  
  2.   while ($f = $res->FetchRow()) {
  3.     echo '<a href="' . writeUrl($f['slug'],$cat,$subCat) .'">' . $f['product_name'] . '</a>';
  4.   }


301 redirects

You also need to ensure that the old style URLs are no longer available. The easiest way is to check for the value of $_SERVER['REQUEST_URI']
If a '?' is present it's an old style one, and so retrieve the data, pass it through the writeUrl() function, and redirect.

By checking for old-style URLs it does at least mean that missing a hard-coded URL somewhere in your site isn't going to lead to duplicate pages.

I would also implement a check for the categories. If you happen to move the product to a different category, the URL would still work if you were just searching the database for $_GET['Slug'].

Perhaps even consider removing the categories from the URL altogether. That way it may be possible to remove some database requests for category data just to construct the URL (speeding up the site), and should you decide to change categories you don't have to change the URL as well (providing long term URL stability).



Without seeing the existing code for your site I can't really be any more precise, but it should at least give you some food for thought.
Comments on this post
johnafrankllin agrees!
__________________
... I'll be back for breakfast
New to SEO? SEOChat SEO FAQs
Forum Rules and Posting Guidelines
URL canonicalization code solutions
Vigorously pursuing the floccinaucinihilipilification of cheap SEO tricks

Reply With Quote
  #14  
Old September 9th, 2008, 03:20 PM
Joppiesaus Joppiesaus is offline