ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Several hundred lines of .htaccess permanent redirects: Effect on site performance?

April 13, 2008 8:09am

Subscribe [2]
  • #1 / Apr 13, 2008 8:09am

    deus62

    15 posts

    Hi,

    I’ve just completed a several-hundred lines long .htaccess (mostly) permanent redirect file. There simply was no way of using a more efficient rewriting procedure ... the links at the old/new sites were incompatible to the extreme.

    Question: How does an .htaccess file like that effect any site’s performance? Is it at all noticeable? I couldn’t really find any info on that.

    Note: I’m using the file (about 350 lines long, plus a few other lines with other stuff) to redirect a whole bunch of top spots on Google around the world from an old to a new version of a site that has changed backend.

    Thanks for your input (even if it’s Sunday ... I should be out in the bright sunshine ... *groan*)

    Cheers!

  • #2 / Apr 13, 2008 8:16am

    Mark Bowen

    12637 posts

    Well at least you’re getting some sun! :down:

    From what I know of .htaccess files (and I’m sure others will chime in here if I’m wrong) they load on every single page that you call up on your site if it is a site-wide .htaccess file. Wherever you can and if you have access to your php.ini file then you can place a lot of items into that instead as the commands will only be called up when required instead of on every single page whether they are needed or not.

    As to what you can do if you don’t have access to the php.ini file and how much of an adverse effect they can have on a site then for this I will gracefully back down and let someone else answer that one if I may? 😉

    Hope that helps a bit though.

    Best wishes,

    Mark

  • #3 / Apr 13, 2008 8:33am

    deus62

    15 posts

    Yo, Mark! 😉

    You should also be out playing in the sun (if you have any wherever you’re located at).

    As far as I can tell, I don’t have access to the php.ini file.

    The file, as it stands, is about 250 lines long and redirects two URLs from the old site for each post to one of the new site. Unfortunately, Google caught both the permalink and the comments link on many important pages and to be on the safe side, I’ve redirected both instead of using a “permanently gone” instruction on the comments URLs. The latter I did because two top spots were indexed under the comments link instead of the permalink one (just my luck; God knows what else they indexed).

    I’m quite sure that in a couple of weeks/a few months, Google will have caught up (I’m also supplying a detailed site map of the new site to Google via the webmasters shanola the site is registered with at Google and am telling them to re-index the site as soon as possible), but I don’t feel like starting a fencing match with 404 errors.

    Cheers, and thanks for the input!

    Note: The cheers is meant literally. It’s 13:31 here and I’ve poured myself a drink because I just finished the whole site in question. Done. Completed. Hip-Hip-*burp* 😉

  • #4 / Apr 13, 2008 8:40am

    Mark Bowen

    12637 posts

    Well I’m glad someone gets some sun. Here in Birmingham, UK we generally don’t get to see it :down: probably due to the layer of thick smog that descends upon us all the time!!

    Thanks for the cheers, have one on me!! 😉

    Hopefully some others will pop in and give their thoughts on this as I am only going by what I have read and I do have access to the php.ini files on nearly all the sites I create so I always do it this way just because of what I read on this. I’m really not sure what kind of a hit not doing it in that way would have on a site though as I only ever have a few very simple lines to add anyway so in my cases probably wouldn’t be a lot but as they say “Every little helps”.

    Hope it all goes well for you.

    Best wishes,

    Mark

  • #5 / Apr 14, 2008 3:49pm

    Kristof Rutten

    83 posts

    @deus62 ~ are you just using rewriterule or rewritecond too?

    It al depends on the syntax you are using, if it has to evaluate every single rule it will bog down the server (try enabling mod_rewrite logging on the highest level ~ you’ll see how much work it has to do).

    Are you sure you can’t use some Regular Expressions to get the total number of lines down?
    Maybe you can post some part of the code and have some real gurus take a look at it.

    I’ve learned a lot from a book called : “The definitive guide to Apache Mod_Rewrite”.
    You can get it from Amazon.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases