Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you are doing this to avoid getting multiple links to the same content, you can simply don't use "register.php" anywhere on your page. I think no search engine will "guess" for a certain file type and if there are no security concerns you are on the safe side, because in my opinion no user will link to this file either. However if you want to be certain just reroute all your functionality through an index.php via one line in your .htaccess which should be placed inside your www-root directory:</p> <pre><code>RewriteEngine on RewriteRule ^(.*?)$ index.php?file=$1 </code></pre> <p>In your index.php you can then simply choose which function/file to invoke by breaking down and checking the $_GET["file"] parameter. To make 100% certain no one can access your register.php file directly just move it (and all your others) to a separate directory and include a .htaccess file with the following line:</p> <pre><code>DENY from all </code></pre> <p>There are a couple of other options to prevent direct access. Just <code>define()</code> a variable somewhere in your index.php and at the top of your register.php just put</p> <pre><code>defined('access') or die('Intruder alert!'); </code></pre> <p>at the top. Another way could be to be honest and simply tell search engines that your content has been moved and that they no longer should use the old link:</p> <pre><code>header("Status: 301"); /* Content moved permanently */ header("Location: http://yourserver/Register/"); exit; </code></pre> <p><strong>Update</strong></p> <p>Just one more thing that crossed my mind, you can also check <code>$_SERVER["REQUEST_URI"]</code>, whether the user attached any ".php" and act accordingly by either denying access completely or just redirecting to the new location.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload