Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    54
    Thanks
    4
    Thanked 0 Times in 0 Posts

    How to stop my PHP files being indexed

    Hi there - I have a small php script that does some stuff and then uses header("location:url") to redirect to another page.

    The filename of the script is randomly generated as I don't want people to stumble upon it.

    Does anyone please have any ideas how I can stop this script being indexed by Google. I don't want people to find it (hence the random name).

    I can't use a meta tag as I am using header:location to redirect.

    There isn't much point in using robots.txt as that is just leaving a nice handy list of pages that I don't want people to find LOL.

    Does anyone have any ideas please ?

  • #2
    Regular Coder
    Join Date
    Jun 2009
    Posts
    144
    Thanks
    3
    Thanked 20 Times in 20 Posts
    If its dynamically created, how does the robot index something that doesnt exist?

  • #3
    New Coder
    Join Date
    Nov 2011
    Posts
    54
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hi itxtme - thanks for the post. I should have been a little clearer. The file IS dynamically created along with a directory full of other files that are created at the same time. However, once created, that directory and its files (including the "hidden" one) stay put and remain static. In fact, forget the fact that is dynamically created - that's not important for this scenario.

    I suppose it would be better for me to ask : How do I stop a php script being indexed by Google so people can't find it - Can't use meta tags because I do a header redirect at the end of it?

  • #4
    New Coder
    Join Date
    Nov 2011
    Posts
    54
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I suppose I could write out some Javascript from PHP and use window.location BUT then people who have Javascript disabled wouldn't redirect.

    Does anyone know if I could somehow do this via output buffering ?

    Basically the php script doesn't actually write anything to the page - It just does a few calculations, writes a couple of files and then redirects. If I create the page with some HTML on containing the meta-tags for no-index and then buffer the PHP output, will this work? I know it will probably work in terms of the redirect but will it work in terms of Google not indexing the page ?
    Last edited by spman; 04-23-2013 at 09:16 AM.

  • #5
    Regular Coder
    Join Date
    Jun 2009
    Posts
    144
    Thanks
    3
    Thanked 20 Times in 20 Posts
    What about a dynamic lock for each page, so that only users with that key can access it??

    PHP Code:

    if(!isset($_GET['key']) || $_GET['key']!='Shx3Sko9Jsmc3'){
    echo 
    "Error";
    exit();

    Short of that I could only think that you can password protect it with htaccess..

  • #6
    Regular Coder
    Join Date
    May 2012
    Location
    USA
    Posts
    102
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Is it really possible to stop that auto generated script ? If yes, then please share it.

  • #7
    Regular Coder
    Join Date
    May 2012
    Location
    USA
    Posts
    102
    Thanks
    0
    Thanked 7 Times in 7 Posts
    I too have a script that I don't want to get crawled by any robots. What should I do ?

  • #8
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    need to specify in the rewrite rules the pattern which dynamically created pages follows


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •