Support » Fixing WordPress » Stop cPanel from creating redirect rules from .htaccess

  • This isn’t “exactly” a WordPress question, but it affects WordPress and I am hoping someone here has the solution.

    I have a domain with numerous add-on domains, and each domain has it’w own .htaccess file to help with the WordPress files and redirects.

    I recently switched hosting companies and noticed that when I did, the cPanel “Redirects” section created a bunch of rules based on its interpretation of the redirects in the .htaccess files for each and every domain. However, since cPanel read ALL of the .htaccess files for all of the add-on domains, the rules that cPanel created are applying to all the domains when they should not be. This is blocking some posts and pages in wordpress, sending some links to other domains, and creating some infinite loops. All very frustrating.

    If I deleted the redirects in cPanel, it deletes them from the .htaccess file it pulled them from. If I put it back into the .htacess file, cPanel recreates the rule.

    Does anybody know how to “divorce” these two? I still want to create custom redirects in cPanel, but I don’t want cPanel to be able to read or write to the .htaccess files.

Viewing 1 replies (of 1 total)
  • Yep, some of the tools in cPanel seriously malfunction. The concept was a good one, but unfortunately not enough conditional checking code was added to several of the cPanel tools and disable / enable do not seem to actually really work for at least 3 or 4 cPanel tools: HotLink Protection, Redirects, IP Deny and another tool that I cannot remember the name, but has something to do with add-on domains.

    There is only one way that I have found to permanently resolve these cPanel tool problems. You need to lock your root .htaccess files with 404 or 444 Read Only file permissions. This will prevent these cPanel tools from being able to write to/wreck your .htaccess files.

    It is always better site design and site architecture to compartmentalize your security and configuration files – .htaccess files. The same applies to adding redirects for each site – you should keep your .htaccess redirects compartmentalized to each site and have that redirect .htaccess code in each site’s root .htaccess files.

    I see that you are using the BulletProof Security plugin from another comment you posted in another thread so you can use BPS Custom Code to create and permanently save your .htaccess redirect code for each site.

    See this Forum post on how to create and add .htaccess redirect code and also watch the BPS Custom Code video tutorial – a link to this video tutorial is on the BPS Custom Code page.

    htaccess Redirect Code – Where Do I Add Redirect htaccess Code

Viewing 1 replies (of 1 total)
  • The topic ‘Stop cPanel from creating redirect rules from .htaccess’ is closed to new replies.