Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess is being overwritten by version control. Solutions to prevent this?

Discussion in 'General Discussion' started by spaceman, Apr 27, 2018.

  1. spaceman

    spaceman Well-Known Member

    Mar 25, 2002
    Likes Received:
    Trophy Points:

    For the second time in a month or so, a client of ours has reported that the URL redirects he setup in cPanel have disappeared.

    The answer: both times we patched the (Drupal) site using version control, and this caused the .htaccess file to get overwritten.

    The challenge here is that, ideally, or at least from a version control perspective, clients shouldn't be allowed to make file changes to the live site. And yet, when they make use of the cPanel feature that allows them to setup URL redirects (and doubtless some other cPanel features), they get to, unwittingly, make file changes directly to the live version of their site.

    We could remove this (and other) features from cPanel that allows them to do this. But we don't think this is reasonable, because some clients want the freedom to do this themselves.

    So perhaps we have to change the way we manage version control?

    How have others addressed this issue please?



    p.s. For this particular client we've implemented a workaround which we think is solid: we moved the subdomain (that was being redirected from) outside of the public_html folder, then re-added the redirects. But that's a very specific solution for this client. We need a more general purpose solution for all clients.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello @spaceman,

    We'll begin adding support for Git version control in cPanel & WHM version 72. You can read more about this under "Best Answer" in the comments section of the following feature request:

    Allow users to install websites from version control

    Let us know if you have any questions about how this will work.

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice