.htaccess RewriteCond excluding directories does not work when there is an .htaccess or php.ini in subdirectory

You can try adding RewriteEngine On to the top of the subdirectory .htaccess file. This will have the effect of completely overriding the mod_rewrite directives in the parent (ie. WordPress) .htaccess file, because mod_rewrite directives are not inherited by default. So by enabling the rewrite engine in the subdirectory, the WordPress front-controller will not execute … Read more

where to add redirection rewriterule in .htaccess file?

Your external redirect needs to go at the very top of your .htaccess file, before the WordPress front-controller (ie. before the # BEGIN WordPress section). If you place it at the end of the file then it will simply never get processed, because the WordPress front-controller routes all URLs and then stops further processing. If … Read more

.htacess rewrite condition: page to seconddomain/page

RewriteCond %{HTTP_HOST} ^seconddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.seconddomain.com$ RewriteRule ^(.*)$ index.php?page_id=78 [NC,QSA] The “problem” with this is that it rewrites seconddomain.com/<everything> to /index.php?page_id=78. If you only want the second domain’s home page to be served with page_id=78 then you should change the RewriteRule pattern to match just the home page (ie. an empty URL-path). For example: … Read more

Only Allow Front End Access

You want users to Sign Up before they can see any page on your website? If that’s what you need then I think this is something I can do using jQuery. Try adding this code to your footer.php in the very end before the tags. <script> jQuery(document).ready(function($){ if (!$(“body”).hasClass(“logged-in”)) { window.location.replace(“/register”); } }); </script> Now, … Read more