• Resolved sally

    (@sallyruchman)


    Hello,

    I use the Redirection Plugin and Bulletproof Security. I would like to change from WordPress Redirects to htaccess redirects. I created an Apache Group and set the path to my htaccess File in the Redirection Plugin. Htaccess File Permissions are set to 644. Theoretically, the Redirection Plugin should now write the redirects directly to the htaccess File, but it’s not working.

    What are the Settings in BPS to allow the Redirection Plugin to write to htaccess File?

    Thx
    Best regards

Viewing 15 replies - 16 through 30 (of 38 total)
  • Thread Starter sally

    (@sallyruchman)

    The Good Point when adding the Redirect manually would be that via custom code method, the redirect would be added after the hta content, and not on Top of the hta File …

    Plugin Author AITpro

    (@aitpro)

    Ok so I probably should have checked on this first before jumping ahead. Yes, a very large number of redirects are going to be faster using htaccess code vs using WP DB URL rewrites/redirects, but what I need to know now is what is the total number of redirects that you expect to add over time?

    • This reply was modified 5 years, 1 month ago by AITpro.
    Thread Starter sally

    (@sallyruchman)

    difficult to estimate… with one website like max 200 redirects, with the other website frequently updating like 1000 redirects …

    Plugin Author AITpro

    (@aitpro)

    Regarding your other reply – redirect htaccess code can go anywhere in an htaccess file. It can go at the top or bottom of the htaccess file or anywhere else in the htaccess file as long as the redirects are not added inside the WordPress Rewrite loop htaccess code. For simplicity sake just top or bottom is fine. Not going to go into explaining the WordPress Rewrite loop. ??

    Plugin Author AITpro

    (@aitpro)

    Ah ok then just use/create redirects in the Redirection plugin and don’t try to write the htaccess code redirects into your root htaccess file. 1,000 redirects is basically nothing. You might shave off .01 – .1 second max at best using htaccess code redirects. If on the other hand you were doing 10,000+ redirects then yeah you would definitely want to use htaccess code vs WB DB URL rewriting/redirects.

    Thread Starter sally

    (@sallyruchman)

    every millisecond counts, so I would like to use the htaccess redirects. So the Solution is copy the Redirects after saving them out in Custom Code Field 14. How to avoid that Redirection Plugin ads additional the same Redirects automatically then?

    Thread Starter sally

    (@sallyruchman)

    I mean the Redirection Plugin has over 1 Million Downloads, I guess there are a Lot of Website Owners who want to redirect via hta File and have also BPS installed…

    Plugin Author AITpro

    (@aitpro)

    Well unfortunately, if you definitely want to go the htaccess code redirect route then you are going to have to deactivate BPS Root folder BulletProof Mode, which will create a default WordPress htaccess file and of course remove all of the BPS security rules htaccess code.

    I don’t think there is a better solution because trying to keep up with doing the extra steps of using BPS Custom Code and keeping track of what you are doing in the Redirection plugin is probably going to make you crazy. ??

    There is another possible solution to keep both BPS htaccess security rules and allow the Redirection plugin to write to the WordPress default htaccess file, but that solution will only work depending on how/where this particular website is installed in the folder structure of your hosting account. So using basic folder/file path examples below, let me know where this particular website is installed under your hosting account.

    /public_html/ – is the hosting account root folder.
    /public_html/example-wordpress-site/ – would be the hosting account folder where the “example-wordpress-site” is installed.

    • This reply was modified 5 years, 1 month ago by AITpro.
    Plugin Author AITpro

    (@aitpro)

    Regarding your other reply…

    I mean the Redirection Plugin has over 1 Million Downloads, I guess there are a Lot of Website Owners who want to redirect via hta File and have also BPS installed…

    Yeah, but typically the average person may do a redirect here or there, but definitely not as many as you are doing on an ongoing basis. So no one has ever asked me about this particular scenario before. ??

    Thread Starter sally

    (@sallyruchman)

    ?? Regarding the Folder Structure:

    1. Website:
    /var/www/vhosts/domain.com/httpdocs

    2. Website (Subdirectory Install)
    /var/www/vhosts/domain.com/httpdocs/wp

    Plugin Author AITpro

    (@aitpro)

    Ok that will work for this alternate/workaround solution below.

    1. Go to BPS Custom Code and delete any redirect code that you added for the Redirection plugin redirects.
    2. Click the Save Root Custom Code button.
    3. Go the Security Modes page and click the Root Folder BulletProof Mode Activate button.
    4. Copy the existing BPS Root htaccess file from the /var/www/vhosts/domain.com/httpdocs/wp folder to your hosting account root folder: /var/www/vhosts/domain.com/httpdocs.
    5. Now click the Root Folder BulletProof Mode Deactivate button.

    So the BPS root htaccess file that you copied to your hosting account root folder will have and apply it’s security rules to all child folders, which includes the /wp folder in your example path above (your WP site). Since you have deactivated BulletProof Mode then a default WordPress htaccess file will be created in the /wp folder. BPS will no longer alter or modify or write to the default WordPress htaccess file. The only thing you have to remember is to NOT activate Root BulletProof Mode in the future. ??

    Plugin Author AITpro

    (@aitpro)

    Oh and finally you will obviously need to resave any existing redirect rules that you previously saved in the Redirection plugin so that those redirects are written into your new default WordPress htaccess file. That is a one-time thing. All new redirects that you save in the Redirect plugin will continue to be added to the default WordPress htaccess file.

    Thread Starter sally

    (@sallyruchman)

    thanks will test this out

    Thread Starter sally

    (@sallyruchman)

    Hello, i tested yet, but the workaround solution without activating the root bulletproof mode i don′t like. I tested yet with 1 redirect created by the Redirection Plugin to add it to root custom code Field 14 as you wrote me, but when copying the following code snippet, the redirect did not work:

    <IfModule mod_rewrite.c>
    RewriteRule ^business-coach$ https://domain.com/business/ [R=301,L]
    </IfModule>

    Plugin Author AITpro

    (@aitpro)

    Did you activate Root folder BulletProof Mode again AFTER adding/copying the redirect code into BPS Custom Code? BPS Custom Code is for permanently saving any additional custom htaccess code. To actually write your saved custom htaccess code into your Root htaccess file from BPS Custom Code you need to activate Root Folder BulletProof Mode again.

    • This reply was modified 5 years, 1 month ago by AITpro.
    • This reply was modified 5 years, 1 month ago by AITpro.
Viewing 15 replies - 16 through 30 (of 38 total)
  • The topic ‘Redirection Plugin and htaccess’ is closed to new replies.