WordPress SSL htaccess code – Rewrite SSL, RewriteCond Server Port

Home Forums BulletProof Security Pro WordPress SSL htaccess code – Rewrite SSL, RewriteCond Server Port

This topic contains 107 replies, has 18 voices, and was last updated by  AITpro Admin 6 months, 4 weeks ago.

Viewing 3 posts - 106 through 108 (of 108 total)
  • Author
  • #36691

    AITpro Admin

    Yes, see this Reply in this same forum topic > https://forum.ait-pro.com/forums/topic/wordpress-ssl-htaccess-code-rewrite-ssl-rewritecond-server_port/#post-7233. Also check your WordPress General Settings (WordPress Address (URL) and Site Address (URL))   to make sure they are correct.



    Hi there, I’m having an unusual issue with SSL redirects on a client site that I just migrated to GreenGeeks hosting. It did not previously have SSL, so we wanted to have them install it for us. I had disabled BPS while they installed the SSL cert, and the rewrite code they put at the top of the the default htaccess file was:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} domain\.com [NC]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://domain.com/$1 [R,L]

    That worked fine, http to https and www to non-www, but at the expense of not having any BPS security in htaccess of course.

    I can’t seem to save any edits in custom code on any site I have hosted at GreenGeeks, so I have to edit htaccess on the server. To do this, I replaced the default rewrite code in the CUSTOM CODE WP REWRITE LOOP START section. Redirect loop. So I replaced it with the first version you have on the WordPress SSL htaccess Code page here at ait-pro.com, updating successively as I followed the instructions on the page. None of them worked. So I’ve fallen back to the default with the working rewrite code for now, but I wonder if you can tell me if there is something special I need to do at GreenGeeks, or if this is something else non-hosting related that can be remedied easily.

    I do have the site set up as https in the WordPress General Settings, and have replaced all non-secure urls with secure ones in the database. No SSL “helper” plugins installed. Just tried running the setup wizard and the redirect loop reoccurred. Returned to the default with GG https rewrite code at the top (before the # BULLETPROOF DEFAULT .HTACCESS  line) and it performs as expected.

    I know there’s a way to get this to work, but I’m not finding it on my own. I may be doing something wrong in REPLACING the default rewrite rules in the BPS htaccess with the rewrite code provided by GG? Maybe you can clarify that since I’m not sure if my attempts to add it by hand are correct and I don’t have BPS to back me up since Custom Code won’t save.

    Thanks for any help you can offer.

    PS: I really like GreenGeeks hosting, but it is very annoying to continually get 403 errors when trying to save Custom Code. Is there anything to be done about that?


    AITpro Admin

    @ Hannah – The Custom Code not saving problem is caused by Mod Security installed on your web host.  Contact your web host support and ask them to either create Mod Security whitelist rules for your website, remove/delete the Mod Security rules causing the problem or disable Mod Security for your website. Once you have fixed the Mod Security problem then you can move forward again.

    Mod Security – Common known problems

Viewing 3 posts - 106 through 108 (of 108 total)

You must be logged in to reply to this topic.