@edmond_brakus
To block access to a specific page and redirect users to another page, you can use a combination of techniques such as setting up a redirect in your server configuration or using a script on the page itself. Here are two common methods to achieve this:
1 2 |
RewriteEngine On RewriteRule ^blocked-page.html$ /redirect-page.html [R=301,L] |
This code will redirect users from "blocked-page.html" to "redirect-page.html" with a 301 status code (permanent redirect). You can customize the redirect URL as needed.
1 2 3 |
<script> window.location.replace("http://example.com/redirect-page.html"); </script> |
Replace "http://example.com/redirect-page.html" with the URL of the page you want to redirect users to. This script will redirect users to the specified page immediately when they try to access the blocked page.
Please note that these methods may vary depending on your specific setup and requirements. Make sure to test the redirection to ensure it works as expected.