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 there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Moving rewrites from htaccess into httpd.conf?

  • 11-12-2013 10:55am
    #1
    Registered Users, Registered Users 2 Posts: 81,220 ✭✭✭✭


    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,830 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, Registered Users 2 Posts: 81,220 ✭✭✭✭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, Registered Users 2 Posts: 7,740 ✭✭✭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,830 Mod ✭✭✭✭oscarBravo


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


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


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


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 81,220 ✭✭✭✭biko


    Aye Helicon, bad spelling on my part.


  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 81,220 ✭✭✭✭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