Making the Index of / invisable

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
Wayno717
New to forums
New to forums
Posts: 3
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed May 14, 2014 3:13 am

Making the Index of / invisable

Post by Wayno717 »

Hi i wan't to make the Index of / page invisable to people as when people go to my website http://civilization.site.nfoservers.com/ they will see all my folders. I wan't to default it to http://civilization.site.nfoservers.com/forum/

Thanks - Wayne
doulos9
This is my homepage
This is my homepage
Posts: 200
Joined: Sun Sep 15, 2013 9:44 pm

Re: Making the Index of / invisable

Post by doulos9 »

There are several ways to redirect traffic to a subfolder:
  • 1. Add the following lines to .htaccess (if you have one):
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
    RewriteRule ^(/)?$ blog [L]

    The only change you need to make is to change “YourDomain.com” to your domain. This will then redirect everything from the domain to the folder /blog at that domain. If you want to change that folder just edit the “blog” part.

    2.Using HTML: create an index.html file and add this:
    <html>
    <head>
    <meta http-equiv="refresh" content="0;url=http://civilization.site.nfoservers.com/forum/ ">
    </head>
    <body>!--redirect traffic to the forum subdirectory--></body>
    </html>

    3. Using PHP: create an index.php file and add:
    <?php
    //redirect all traffic to the forum directory
    header( 'Location: http://civilization.site.nfoservers.com/forum/ ' ) ;
    ?>
Post Reply