Forum Moderators: phranque

Message Too Old, No Replies

Is there a limit on the 301 entries in httpd.conf

         

scraulb

5:45 pm on Mar 14, 2009 (gmt 0)

10+ Year Member



I have a website which contains about 10,000 jpgs.
We want to change the links of all of these.
Unfortunately the directories and the names of the jpgs have changed.

Is it possible/desirable to have 10,000 301 entries in my httpd.conf file? If not what would be a good number? In other words what is the limit on the httpd.conf file?

jdMorgan

6:21 pm on Mar 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you keep the filenames and change only the directory-path, then you might be able to do the redirect with only one line (or a few lines) of code.

While there is likely no technical limit (short of filesize restrictions in your server's OS) to the number of redirects in a config file, I would never recommend going over a few hundred, since the server will have to process all of them for every incoming HTTP request -- or at least for every incoming HTTP request for objects with a .jog extension if you structure the code correctly (Use a <DirectoryMatch>, <LocationMatch>, or <FilesMatch> container around mod_alias redirects, or a "skip rule" around mod_rewrite redirects to prevent unneccessary processing of those image redirect directives).

If all of the links you care about are from inside your own site, I'd say change all of your on-site links, redirect only the "very important ones" which have inbound links from other sites, and forget the rest. If you have tons of inbound links from other sites and keeping those links working is important, then I'd say don't change the URLs. It's likely that your "best-fit" solution lies somewhere in the middle.

Jim

scraulb

3:55 pm on Mar 15, 2009 (gmt 0)

10+ Year Member



Thanks for you thoughtful response.

From your comments I think we have decided to leave our old pictures where they are and add all the new pictures with a different filename and size. All links on the site will go to the new pictures. Eventually the old pictures will die off in the SE's. To speed up the die off we could add 301's a hundred at a time in httpd.conf

We are mostly worried about Google images as we get a large number of hits from this.

Does this sound good to you?

Thanks

John

jdMorgan

4:41 pm on Mar 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Leave the old images until the new ones are getting the vast majority of the traffic. As noted above, if you 301 them, those 301s will need to stay in place for years (or forever) if there are any off-site inbound links to the redirected image URLs. Analyze the old image request traffic, too; You might change your mind about removing some of those images if they still get a lot of traffic even after a year or more of being un-linked on your site.

If it isn't clear, a 301 is not a one-time switch that tells the search engines "don't ever request this old URL again after you find this redirect." Instead, it is a pointer that must stay in place if you want the search engine to continue to use the new URL after following a link to the old URL. In other words, the URL replacement persists only as long as the redirect remains in place.

Putting the new images in a separate directory would be a good idea, because if the traffic analysis warrants it, you can then remove the entire old-image directory all at once in the future.

Since I don't know your market segment, what these images are, and what part they play in the promotion or popularity of your site, I can't really offer informed "business advice," so I should probably just stick to discussing the technical aspects of redirects here.

Jim

Caterham

4:58 pm on Mar 15, 2009 (gmt 0)

10+ Year Member



to have 10,000 301 entries in my httpd.conf

May be it's worth to take a look at the option using a RewriteMap, type dbm (that is more or less an "indexed binary text file" but it is faster than a text file lookup) might be preferable than using a lot of individual entires. The lookup results are cached as well.

scraulb

8:04 pm on Mar 16, 2009 (gmt 0)

10+ Year Member



Thanks again Jim.

We were planning on keeping the images up for a long time. Good advice about analyzing inbound links. (We see google mostly now)

We were also aware if another site has a link to us and we 301 it Google still uses the 301 to get to the new page from the other site. We still have 8 year old .shtml 301's in place! Thanks for reminding me!

We have all our old images in a different directory to our new ones. Whew!

Caterham.
I think the idea of cluttering up the httpd.conf etc with redirects is just too much maintenance for us to worry about. BUT if we change our minds I will certainly look into this idea. I think the best bet based on what Jim said is just to keep the old photos and introduce the new and pray that Google/etc eventually drops the old photos when it finds we do not have links to them.

I need a cron job to delete the old photos in 10 years. Ha Ha

Thanks for the help

John

We have