• Hi,

    I have WP installed in a sub-directory of our main site. We use the loop to display the posts on our external website. The posts are not viewed via the WP interface. We do not want the public to be able to access the sub-directory at all. What is the best way to hide it? I’ve tried blanking it out or redirecting to main site but use some aspects of the theme (single.php, etc…) so the index has to remain functional. I can’t think of any way to prohibit access without breaking the installation. Any suggestions would be appreciated.
    Thanks
    Daf

Viewing 2 replies - 1 through 2 (of 2 total)
  • If your web server is apache, you can use .htaccess file located in the sub-directory.

    NOTICE: A bad .htaccess file may cause some problems.

    For example, this is code that only allows access from the localhost.

    order deny,allow
    deny from all
    allow from localhost

    Thread Starter daf57

    (@daf57)

    Thanks, Aoba. I’ve not had any luck with the .htaccess file. It does hide the index from the public but breaks the theme – I need the theme intact as I use the single.php to display the posts on the remote site.

    Thanks tho.
    Daf

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hiding Install Directory Index’ is closed to new replies.