.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

How to write .htaccess so that https is on for subpages only but not the home page

Presumably your .htaccess file is located in the /abc subdirectory? In which case you can do something like the following to force HTTPS on all sub-pages, except the homepage: This needs to go at the very top of your .htaccess file: RewriteCond %{HTTPS} !on RewriteRule !^(index\.php)?$ https://example.com%{REQUEST_URI} [R=302,L] This assumes that the SSL cert is … Read more

How disable canonical redirect wp-signup

The <Files> directive is used to target specific files on the filesystem, not URLs. To change this to target any URL that starts /wp-signup then use mod_rewrite instead. For example: RewriteRule ^wp-signup – [F] This must go at the top of your .htaccess file.

External content won’t load in iframe in Safari

X-Frame-Options: sameorigin By itself (and in older browsers) this would certainly deny access. However, in compliant browsers you would expect the Content-Security-Policy: header to override this. Assuming you have control over this external content, have you tried setting this header to: X-Frame-Options: allow-from https://example.com Or X-Frame-Options: sameorigin, allow-from https://example.com (Although Safari may not support the … Read more