Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Moving rewrites from htaccess into httpd.conf?

Options
  • 11-12-2013 11:55am
    #1
    Registered Users Posts: 81,223 ✭✭✭✭


    Has anyone done this?
    It seems pretty straightforward (adding Directory in httpd.conf) but I'm wondering if there is some performance decrease/increase I should know about, or any other "hidden" roadblock?

    It's Helion on Windows machines btw if that matters.


Comments

  • Technology & Internet Moderators Posts: 28,791 Mod ✭✭✭✭oscarBravo


    I would suspect that, if anything, performance would improve - httpd.conf is read only on server startup, whereas .htaccess files are read on every request.

    The logical corollary is that you need to reload your web server if you change rewrite rules in httpd.conf.


  • Registered Users Posts: 81,223 ✭✭✭✭biko


    Yeah, I expect a (tiny) improvement in speed as local rules aren't needed.
    Right now we use maybe 900 rules in httpd and maybe 50 in htaccess, so its not like moving rules from htaccess to httpd will increase the burden there much.

    It should be ok to just append the htaccess rules last in httpd yeah?
    I will of course test every rule in a test environment I have. This stuff could easily break an entire site if done wrong.

    Old rules
    Old rules
    Old rules
    Old rules
    Old rules
    Old rules
    New rules
    New rules
    New rules


  • Registered Users Posts: 7,739 ✭✭✭mneylon


    biko wrote: »
    Yeah, I expect a (tiny) improvement in speed as local rules aren't needed.
    Right now we use maybe 900 rules in httpd and maybe 50 in htaccess, so its not like moving rules from htaccess to httpd will increase the burden there much.

    It should be ok to just append the htaccess rules last in httpd yeah?
    I will of course test every rule in a test environment I have. This stuff could easily break an entire site if done wrong.

    Old rules
    Old rules
    Old rules
    Old rules
    Old rules
    Old rules
    New rules
    New rules
    New rules
    You should check the syntax of any rules you're adding, or Apache will just sit there and "laugh" at you and not restart

    See for syntax http://httpd.apache.org/docs/2.2/programs/apachectl.html

    (no idea what Helion is and Google wasn't particularly helpful)

    The downside to moving rules directly into your server config is that you'll need to restart the server / service any time you make a change, while you can just pop in a new version of .htaccess without anything else

    Having 900 rules seems a bit excessive - isn't there a way for you to combine them or use a regex?


  • Technology & Internet Moderators Posts: 28,791 Mod ✭✭✭✭oscarBravo


    Blacknight wrote: »
    (no idea what Helion is and Google wasn't particularly helpful)
    I'm guessing Helicon.


  • Registered Users Posts: 7,739 ✭✭✭mneylon


    oscarBravo wrote: »
    I'm guessing Helicon.
    Ah - that's a very different animal entirely :)


  • Advertisement
  • Registered Users Posts: 81,223 ✭✭✭✭biko


    Aye Helicon, bad spelling on my part.


  • Registered Users Posts: 1,082 ✭✭✭Feathers


    apachectl programme on Unix is a god-send alright! Can't believe I was manually debugging httpd.conf for years before I knew about it :)


  • Registered Users Posts: 81,223 ✭✭✭✭biko


    Blacknight wrote: »
    Having 900 rules seems a bit excessive - isn't there a way for you to combine them or use a regex?
    Yeah sounds like a lot but the majority of the httpd rules are just simple redirects from my site to a partner site
    RewriteRule ^/products/nl/333 http://www.partner.com/nl/products/333 [R=301]

    Btw I have some Qs about the syntax of some of the rules themselves, I'll start a new thread on that.


Advertisement