Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello

    Do you know about robots.txt ?
    If yes then go in that file and type the following lines in it and then save.

    User-agent: *
    Disallow: /folder1/

    That’s it..!! Do let me know if you need some other help

    Thread Starter runinasia

    (@runinasia)

    Hi I updated my robots.txt file already.

    Despite changing the robots file, it does not block off visitor from viewing the root directory.

    What i want to achieve is that the people are not able to fee my files on the root directory itself.

    eg.
    they cannot view (https://runinasia.com/wp-content/uploads/)

    There’s two ways for it.

    First (and easiest) is to place an empty index.php file in each folder that you don’t want people to see. For an example, look at the index.php file that comes in the /wp-content/ folder:

    <?php
    // Silence is golden.

    The second way is to add an extra part to your .htaccess file. If you do this make sure that you do it outside of the

    # BEGIN WordPress
    ...
    
    # END WordPress

    area so that it doesn’t get changed when other changes are made.

    To do it this way you need to add this part to your .htaccess file:

    Options -Indexes

    That one line is all that you need.

    Thread Starter runinasia

    (@runinasia)

    Hi catacaustic,

    Thank you for your response.

    I do understand the fact that I can put a blank index file on every folder but this will be very tedious because if I had to create new folder each time I couldn’t keep up with creating the index file.

    I will go with the second way. Thanks anyway, it work well.

    Once again, thank you very much. ??

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to block people from viewing my directory’ is closed to new replies.