how to disable access for a specific url?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ghost
    replied
    simiiar to gumslones solution but with protection and a redirect
    this is what i do add this code to top of file:
    PHP Code:
    /** Prevent direct access from url to file that holds this code
          change db.php to name of fie you add this code into */
    if(stristr(htmlentities($_SERVER['SCRIPT_NAME']), 'db.php')){
    echo 
    '<meta http-equiv="Refresh" content="0; url=index.php">';
    die();

    Leave a comment:


  • something else
    replied
    mod rewrite?
    Code:
    RewriteEngine On
    RewriteRule ^/url/you/want/to/hide.html$ index.html [L]

    Leave a comment:


  • wapxtech
    replied
    Originally posted by lovebirds143 View Post
    hello,
    please anybody tell me how to disable access to specific url
    my urls look like this http://domain.com/folder/?d=folder/subfolder&c=6
    im using an simple load auto index script. i want to disable access for some urls
    you can use base64_decode and encode in your $_GET =)

    for example you fetch ?file=blablabla
    PHP Code:
    <?php
    if(isset($_GET['file']))
    {
    $encoded base64_decode($_GET['file']);
    }
    else
    {
    $encoded ="";
    }
    ?>
    your link should be like this
    PHP Code:
    <?php
    $tofetch 
    "blablabla";
    echo 
    "<a href="".base64_encode($tofetch)."">TEST ENCODED HERE</a>";
    ?>
    this should work =) cannot be readable by bare eyes but can easily be understand.. it will looks like a random strings but it is encoded

    try to understand and you'll get it
    Last edited by wapxtech; 02.03.15, 08:47.

    Leave a comment:


  • GumSlone
    replied
    without seeing the source code of your script its impossible to provide a proper solution,

    a very simple solution would be:

    PHP Code:
    if(stristr($_GET['d'],'folder/subfolder'))exit(); 

    Leave a comment:


  • how to disable access for a specific url?

    hello,
    please anybody tell me how to disable access to specific url
    my urls look like this http://domain.com/folder/?d=folder/subfolder&c=6
    im using an simple load auto index script. i want to disable access for some urls
Working...
X