Struggling with add_rewrite_rule
Have you tried third parameter as “top” into add_rewrite_rule ? Something like this: add_rewrite_rule($regex, $redirect, ‘top’); And also re-save permalink settings.
Have you tried third parameter as “top” into add_rewrite_rule ? Something like this: add_rewrite_rule($regex, $redirect, ‘top’); And also re-save permalink settings.
My advice to you is not to worry about adding in the copious amount of .htaccess rules for forcing browser caching and setting correct expire time values for assets. If you download the W3 Total Cache plugin it handles adding all of the above into your .htaccess file for you. If you would prefer not … Read more
I found out that with the extra rewrite rule added to the Joomla! .htaccess file and with the corrected WordPress .htaccess file – wrong paths – the site started working again. I removed the Joomla! rewrite rule to ignore the WP folder and WP seems to be able to stand on its own now.
I’d encourage you to take one step further back and avoid using URLs to determine theme at all. (And FYI, what you’re describing are subfolders, not subdomains which would be red.example.com.) The reason not to do this is to avoid duplicate content issues with search engines. Technically, you could work around them, but it can … Read more
First one of your variations is the cleanest. You can test your htaccess rewrite rules here: https://htaccess.madewithlove.be/ Important thing about R=301, this means the redirection is permanent.
In case anyone runs into similar issues. Here is what worked, as suggested by ItsMePN. If your site is on a loadbalancer such as CloudFlare, is_ssl() doesn’t work. Neither did it work for me on a site hosted on “Cloudways + Digital Ocean” Here is the gist https://gist.github.com/webaware/4688802 for force-ssl-url-scheme.php you need to download & … Read more
Additionally to using htaccess, you can disable the XML-RPC function by adding the following to your child theme’s functions.php: # Set XML-RPC features to false add_filter( ‘xmlrpc_enabled’, ‘__return_false’ ); add_filter( ‘pre_option_enable_xmlrpc’, ‘__return_zero’ );
Based on the info in the comments, here’s my preliminary answer, hopefully helping to debug the issue rather than a fix as I can’t see enough info for that — not the OP’s fault, rewrite debugging is just a pain. The rewrite rule is obviously passing something to WP but WP isn’t happy with it. … Read more
A good idea might be to get a back up your old htaccess file and see if the issue still occurs. If it does, why not add the code from your existing file to the end of the wordpress file?
This is somewhat of a guess, but it is probably a result of the web server configuration. What your server probably does is to see that the request want to load the blog url of the site. It checks out and sees that blog is a directory adds a slash and redirects to it. Now … Read more