Redirection Plugin and htaccess
-
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
-
I am assuming this is the Redirection plugin that you are using > https://ww.wp.xz.cn/plugins/redirection/
Just stating (reiterating) general info here:
By default the Redirection plugin uses the WP DB to do redirects, but can be configured to write htaccess code to an htaccess file based on this blurb below on the Redirection plugin’s help info. It sounds like you are saying that you have tried to configure the Redirection plugin do that already, but something is not working correctly. Just restating the obvious here to make sure that is what you are really saying. 😉APACHE & NGINX SUPPORT
By default Redirection will manage all redirects using WordPress. However you can configure it so redirects are automatically saved to a .htaccess file and handled by Apache itself.If you use Nginx then you can export redirects to an Nginx rewrite rules file.
I’m not real familiar with the Redirection plugin. So you may want to ask the Redirection plugin author about what the problem might be. The only thing in BPS that would block writing to your root htaccess file would be the Lock htaccess File and Turn On AutoLock option settings on the htaccess File Manager tab page. Check to make sure your root htaccess file is not locked and AutoLock is not turned on. If things still aren’t working after that then check with the Redirection plugin author about how to configure the Redirection plugin to write to an htaccess file.
Or you can just use BPS to do the redirects by creating redirect htaccess code and saving your htaccess redirect code in BPS Custom Code. If you want to go this route then let me know that and I’ll help you create the htaccess redirect rules that you want/need.
-
This reply was modified 6 years, 3 months ago by
AITpro.
I had some spare time to fiddle with this. I installed the Redirection plugin, setup the Apache group, setup all the other options settings that are required and it is also not working for me either. So maybe there is a bug in the Redirection plugin or maybe there is some sort of limitation based on the type of server you have. Not really sure to tell you the truth and definitely don’t have the spare time to dig really deep into the Redirection plugin’s code to see what is or is not going on.
Why did you want to change the default URL redirection from using internal WP DB URL rewriting/redirects to using htaccess rewriting/redirects in your root htaccess file?
You can use both the Redirection plugin’s default internal WP DB URL rewriting/redirection and htaccess redirects in your root htaccess file. What I mean by that is if for whatever reason you need particular redirects for some URL’s to be htaccess code redirects then all of your other redirects can still remain internal WP DB URL redirection using the default Redirection plugin’s settings. In other words, both the default Redirection plugin URL rewrites/redirection and any redirects in your htaccess file are 2 completely separate things. Of course you would not want to use the same URL rewriting/redirects in both the Redirection plugin and redirects in your root htaccess file for the same URL’s that you want to redirect because they would probably conflict with each other and cause infinite redirect looping problems.
-
This reply was modified 6 years, 3 months ago by
AITpro.
-
This reply was modified 6 years, 3 months ago by
AITpro.
-
This reply was modified 6 years, 3 months ago by
AITpro.
-
This reply was modified 6 years, 3 months ago by
AITpro.
-
This reply was modified 6 years, 3 months ago by
AITpro.
-
This reply was modified 6 years, 3 months ago by
AITpro.
-
This reply was modified 6 years, 3 months ago by
AITpro.
Hello,
thanks for the Update in this. I checked the settings Auto Lock is turned off, root .hta is not locked. I have bigger amount of redirects to do, and the .htaccess redirects just faster, so thats why I want to switch to .htccess rewrites.
Do I have maybe to use a Skip Rule for the Redirection Plugin, is maybe Bulletproof somehow blocking the rule update in the .hta File?
Thx
I think we were both posting around the same time and I added additional info in my previous reply.
BPS is definitely not blocking the Redirection plugin. I ran into the same problem you did when testing the plugin. The problem is either specific to the Redirection plugin or the only other logical thing I can think of is this issue has something to do with the server type or configuration. ie DSO vs CGI, etc.
So like I previously said, you can use both the Redirection plugin’s internal WP DB URL rewriting and htaccess code redirection at the same time since they are 2 completely different methods of rewriting/redirecting URL’s. You just don’t want to try to rewrite/redirect the same URL’s in the Redirection plugin and htaccess code redirects in your root htaccess file.
Ok so I think the simplest thing to do is for you tell me exactly what you want to redirect. Most likely you can use RegEx htaccess rewriting rules to minimize the htaccess code needed to do what you want to do.
-
This reply was modified 6 years, 3 months ago by
AITpro.
If you do not want to post your website URL info publicly or you have a large amount of data to post then I’m willing to work with you directly via email. If you want to go that route instead then contact me via my contact page > https://www.ait-pro.com/contact/
Thanks a Lot! I will test again some thing, and contact you directly
Did you get this issue figured out?
When I go to Security Modes and Activate Root Folder and Admin Folder and check under htaacess File Editor Current Root htaccess File nothing is added from the Redirection Plugin. When I go then to the Redirection Plugin Edit an existing Redirect and ReSave , and check then in BPS , then the Redirect is added to to Top of Root htaccess File.
Activating Root / WP Admin Folder then again, and the Redirect is gone from the Root Htaccess File.
Do I have to exclude something in BPS ?
Oh ok that is simple enough to “fix”. BPS has a feature called “Custom Code”, which is used to permanently save any additional custom htaccess code that you always want combined into the existing standard BPS htaccess code/file. When you activate root or wp-admin BulletProof Modes what happens is BPS looks at any and all htaccess code that you have saved in BPS Custom Code and includes that additional custom htaccess code in your Root or wp-admin htaccess files.
Do these steps below to permanently fix this problem and repeat as needed if you add any additional redirects in the Redirection plugin. ie “When I go then to the Redirection Plugin Edit an existing Redirect and ReSave…”.
1. Edit an existing Redirect and ReSave in the Redirection plugin. Note: If you have a bunch of redirects then resave all of them so that you only have to do the rest of the steps below once.
2. Go to the BPS htaccess File Editor tab page > Click the “Your Current Root htaccess File” tab.
3. Copy the Redirection plugin’s redirect htaccess code that was created by saving your redirect(s) in the Redirection plugin settings.
4. Go to the BPS Custom Code tab page and click the Root htaccess File Custom Code accordion tab/button.
5. Paste your Redirection plugin’s redirect htaccess code into this BPS Root Custom Code text box: 14. CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE
6. Click the Save Root Custom Code button. Note: If you have ModSecurity installed on your host server then you may need to click the Encrypt Custom Code button first before clicking the Save Root Custom Code button. Try just clicking the Save Root Custom Code button first and if you see an error or other problem or your code was not actually saved then you will need to repeat step #5, but click the Encrypt Custom Code button first before clicking the Save Root Custom Code button.
7. Go to the Security Modes page and click the Root Folder BulletProof Mode Activate button.You should now see your Redirection plugin’s redirect htaccess code at the bottom of your root htaccess file.
-
This reply was modified 6 years, 3 months ago by
AITpro.
I replied with steps to fix this problem, but my comment is being held in moderation until a WP Moderator can review it. Please contact me via my contact page so I can send you the fix via email > https://www.ait-pro.com/contact/
Every time when I create a redirect with the Redirection Plugin, I have to Update the Code then manually in root htaccess custom code 14. CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE and have to Activate root Folder / Admin Folder again?
Is there not a more elegant option, that the plugin can update the code directly via Skip / Bypass??
What if I copy out all the Redirects manually, and the Redirection Plugin writes again the Redirects to the hta File, how do I prevent Duplicate Redirects?
I assumed this would be one-time deal or maybe every once in a while type of deal, but if you are creating new redirects very frequently then yeah doing all of the BPS Custom Code steps over and over would be a pain. So before I can offer you the best possible solution I would need to know how often you would be adding/creating new Redirection redirect rules.
with one Website monthly and with the other Website almost weekly
-
This reply was modified 6 years, 3 months ago by
The topic ‘Redirection Plugin and htaccess’ is closed to new replies.