Forum Moderators: phranque
Should I wait until the holidays are over? Are the redirects going to bog the web server down? (I'm on a shared host.) Are there alternatives to .htaccess that will not be as harsh? Is the order in which I place redirect significant? For example, product 288 is more popular than product 13, so would putting 288 first in the .htaccess file be more efficient?
> Should I wait until the holidays are over?
That depends on why you want to do this.
> Are the redirects going to bog the web server down? (I'm on a shared host.)
Probably not, if done efficiently.
> Are there alternatives to .htaccess that will not be as harsh?
Depends on how (or whether) you associate old URLs with product numbers.
> Is the order in which I place redirect significant? For example, product 288 is more popular than product 13, so would putting 288 first in the .htaccess file be more efficient?
Yes, if you go for a simple 1:1 replacement, rather than an associative replacement.
...Better get on with that... I'd recommend you make a rule for translating old URLs to new URLs - if possible.
For example, if Blue = 3 and Widget = 1, then product Widget,Blue would naturally be product 13, and if Red was 1 and Green was 2, then products 11 and 12 are defined by the same rule.
The advantage of this is that it greatly reduces the total number of URL rewrites you have to do. You could use a stepwise rewrite, using one rule to rewrite the "1" to "Widget/" and a following rule to rewrite the color code. Using two stepped rules would allow you to greatly reduce the total number of rules required.
If this is not possible, then a straight list of replacements, ordered most- to- least-popular would work. Just make sure you use the [L] flag of RewriteRule to stop processing as soon as a match is found.
Jim
> That depends on why you want to do this.
I am thinking a shorter URL is more practical and looks cleaner. I can actually look up a product by typing in the URL instead of navigating to it for a change. And since WW organizes the forum posts with short URLs, why not? :) There has to be good reason why this forum is displayed as webmasterworld.com/forum92.htm instead of webmasterworld.com/apache-web-server.htm?
> replacements, ordered most- to- least-popular would work
That is the plan:
Redirect 301 /buy-my-widget.htm http://example.com/288.htm
Redirect 301 /keyword-rich-url.htm http://example.com/13.htm
I assume I do not put a [L] at the end of these straight lists, as all the examples I've reviewed do not have them.
[edited by: jdMorgan at 1:47 am (utc) on Nov. 1, 2003]
[edit reason] Neutralized URLs [/edit]
You wrote:
Redirect 301 /buy-my-widget.htm http://example.com/288.htm
Redirect 301 /keyword-rich-url.htm http://example.com/13.htmI assume I do not put a [L] at the end of these straight lists, as all the examples I've reviewed do not have them.
You'd only use [L] if you used mod_rewrite's RewriteRule to implement the redirect:
RewriteRule ^buy-my-widget\.htm$ http://example.com/288.htm [R=301,L]
RewriteRule ^keyword-rich-url\.htm$ http://example.com/13.htm [R=301,L]
Jim
[edited by: jdMorgan at 1:49 am (utc) on Nov. 1, 2003]