You are here: Re: page redirects on dynamically created folders « All PHP « IT news, forums, messages
Re: page redirects on dynamically created folders

Posted by Tony on 05/10/05 00:37

Deano wrote:

> Hi,
>
> Odd little request this (correct me if I'm wrong of course).
>
> I use an online project management tool which allows you to upload files to
> your own webspace and then link to them from the site.
>
> I know I need to set up htaccess security or something similar (as a php
> newbie the various scripts to secure pages are a little beyond me).
> But what I would like to do first is to stop people browsing the site
> structure - so if they find out that www.mysite.com/secrets/confidential
> exists they could type that into the browser, get a listing and start
> downloading.
>
> I'm using this bit of code in a file called index.php which i can place into
> any given folder;
>
> <?
> header("location: http://www.mysite.com/index.php");
> ?>
>
>
> This forces an immediate redirect to the homepage and works as I want it to
> work.
>
> However each new file upload using the site dynamically creates a new
> folder. Is it possible to automatically place a copy of index.php in every
> new folder on my webspace at the same time it is created?
>
>
> thanks
> Martin


Forget PHP for this. Use the webserver.

You mention .htaccess so presumably you have, or are able to create, a
..htaccess file.

Just put the following lines in that file, and place it in your root
directory.


# de-activate indexing of directories
Options -Indexes

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация