WordPress.org

Support

Support » How-To and Troubleshooting » Make index appear in other directories

Make index appear in other directories

  • Is there a way to make the index page show up in default when someone tries accessing say wp-content, or wp-includes through a browser? I’ve seen it done on other people’s blogs and I’m curious as to how it’s done. I know about the silence is golden index page that wordpress provides but it just makes a blank page appear.

    Any help is much appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • yup, you can configure it using htaccess or through your 404.php file

    Could you tell me what I need to write? I have no clue.

    put the following pithy codes into 404.php file of your wp theme:

    <?php
    
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    
    exit();
    
    ?>

    if it doesn’t work, please tell me, i’ll give you another solution. thanks you 🙂

    Sorry this didn’t work. Thanks though.

    didn’t work? the errors?

    btw, you can try the example at my weblog by clicking http://aufklarung.org/wp-content/

    Well, wp-content still showed the files under that directory, but when I typed an invalid URL, the 404 page had an error:
    Warning: Cannot modify header information, so I reverted back to my original 404 page.

    put Option -Indexes in the .htaccess file in your blog root dir.

    Do you put it in like this?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    Option -Indexes
    # END WordPress

    or like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    Option -Indexes
    </IfModule>
    # END WordPress

    or something else entirely?

    So I tried both ways, and I got an Internal Server Error for all pages in my web site.

    I still have no luck with this issue. Can anyone help me?

    Maybe I wasn’t clear enough on what I am looking for. An example site of this in action would be http://little-wonder.net. Try typing the following extentions after the url to see the results:
    wp-config.php, wp-content, wp-admin. You can also try other extensions, even ones you know don’t exist like asdf.

    I came up with a solution, well sort of. What I did was created an index page that had this in it:

    <?php
    header( 'Location: http://suefeng.com' ) ;
    ?>

    and put that into the folders I don’t want people to view such as wp-content, wp-content/themes, wp-content/plugins, etc. It doesn’t use .htaccess or the 404 page, but it still works.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Make index appear in other directories’ is closed to new replies.