Forum Moderators: phranque
The current URL structure is this:
widgets.com/shop.php?crn=89&action=show&show_products_mode=cat_click
The new is:
widgets.com/shop.php?crn=89
The new one looks better but the biggest problem is that even after the upgrade the page is accessible from BOTH URL's
The only reason I'm considering this is that some customers have begun having difficulties with the cart and when I bring these to the manufacturer they just tell me to upgrade.
Here's the questions:
I have over 140 different categories and would have to do a 301 redirect to the new URL's right?
What kind of damage/loss of traffic can I expect and how long for new URL's to rank?(mainly concerned about Goog)
Is there an easy way to code this redirect without adding code for each individual URL?
Answers are appreciated!
> What kind of damage/loss of traffic can I expect and how long for new URLs to rank? (mainly concerned about Google)
Some report no problems at all, while others report poor ranking for months.
> Is there an easy way to code this redirect without adding code for each individual URL?
Assuming you're on Apache and can use mod_rewrite, redirecting as you describe requires only one two-line rule:
RewriteCond %{QUERY_STRING} ^crn=([^&]+)&action=show&show_products_mode=cat_click$
RewriteRule ^shop\.php$ http://example.com/shop.php?crn=%1 [R=301,L]
(I assume you have other rules already working; I did not show the "setup" directives for mod_rewrite.)
That's the short-term fix. For the long term, consider designing your own URL structure (Search-engine-friendly URLs) and then rewriting those friendly URLs, when requested by clients, to the form needed by shop.php. This may help your pages' rankings, and reduce the chance that you'll ever have to change your URLs again.
Jim
I haven't upgraded the cart on my main site yet out of fear.
I've always wanted to have the old URL's rewritten to "SE friendly" URL's but haven't had the guts to do it for fear of losing ALL rankings. The pages in G(category and product) rank pretty well even with those URL's and I believe "if it isn't broke, don't fix it".
I have always wondered how much better they could rank though...
If I were to do a rewrite I could wind up with something like this
"shop/12/" for category pages and "shop/12/971.html" for product pages, right?
Now, If I were to do this would the product links appearing in the category pages have the newly constructed url's?
These would all be created on the fly just like a php page, right?
I'm so confused on rewrites and have read so much about them and redirects that I'm not sure what I'm doing..
So, in order to achieve "friendly" URLs, the script used to generate URLs (as links on your pages) must be modified to use friendly URLs in the links on your pages (some scripts have "SEF" plug-ins available to do this). Once your pages are publishing friendly URLs, then you can use mod_rewrite to "steer" requests for the new friendly URLs to the proper script file(s), and with the proper query string parameters.
It helps a lot to keep in mind that URLs are defined on and by Web pages, and filenames are defined by server file naming. URLs have meaning on the Web side, but not inside the server.
Filenames are defined when you create a file on the server. Filenames have meaning inside the server, but not on the Web.
The magical agent that converts URLs to filenames is called a "server". :)
So, if you change the URLs (making them "friendly") but you don't change the script filenames correspondingly, then something must be used to "re-connect" the new friendly URLs to the existing script filenames. That "something" is usually mod_rewrite.
Since you cannot rename your script to a friendly "static" filename (note that you'd need one copy of the script for each friendly URL!), you *must* use some server-side function to "re-connect" the new URLs to the script(s). This further demonstrates the difference between a URL-path and a filepath.
So there are three steps. In logical order -- but not implementation order, they are:
1) Change your script to produce friendly URLs (or use an available "plug-in").
2) Rewrite requests for the new friendly URLs back to the script filepath with proper query parameters.
3) Optionally, redirect direct client requests for the "old unfriendly" URLs to the new friendly URLs. This can speed up re-indexing and help to get the old unfriendly URLs removed from search engine results.
Mod_rewrite can be used for steps 2 and 3.
I showed the steps above in the easiest order for explanation; To actually implement this, you'd want do the above steps in this order: 2, 1, and then --optionally-- step 3
Jim
/gift-delivery-in-canada/gift-baskets-chocolatechest.asp
/gift/gift-baskets-chocolate-chest-004400.php
/mothers-day-gift-canada/gift-basket-mommylove.asp
The directory names for every category is different and the file url also.
The question is...how many redirects can I put in before the htaccess file gets too 'bloated'? I have 300-500 urls to redirect. Many of my old pages bring in traffic so I'd like to redirect most of them if possible.
Regards,
James...
Regards,
James...