• I have a fool question with the permission: how would I suppose to block visit to a specific directory like wp-content/themes, since when I enter the web address like mywebsite.com/wp-content/themes, all the files under this directory show up! However, when I set the directory permission to 744, the entire website won’t work!

    Would someone help figure this out please?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Turning off directory browsing (or listing) would be easy way to do it.

    You could also, of course, create an empty file named index.php and drop it in there.

    Thread Starter heyzenith

    (@heyzenith)

    hey, thanks HandySolo, I actually tried create a ‘fake’ index.php at each directory which could potentially be visited, but this caused weird problem — the Dashboard turns to that ‘fake’ page automatically! I guess it makes the system confused with which index.php could be read? But how to ‘turn off the directory listing’ please?

    thanks!

    You don’t put a “fake” index in the directories where you already have a working index file – only into the folders that are without!

    Also, found this by google:
    https://www.javascriptkit.com/howto/htaccess11.shtml

    Thread Starter heyzenith

    (@heyzenith)

    You don’t put a “fake” index in the directories where you already have a working index file – only into the folders that are without!

    Thanks moshu. I actually didn’t. I put it under wp-content but strangely the dashboard shows that page.

    But thanks a lot, I did solve the problem by adding ‘Options -Indexes’ in my .htaccess file.

    Cool! Thank you all guys!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to block visit to wp-content/themes’ is closed to new replies.