Help - Search - Members - Calendar
Full Version: Root Path For Page
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
l245c4l
Hello,

Here is my problem. I want to develop a simple site (I am beginner) and I want to keep some scripts and important things away from a public area.
So I want to have hierarchy of directories like this:

/:
>> index.php
>> includes
>> logs
>> public:
>>>> index.php
>>>> stylesheets
>>>> javascripts
>>>> images

I want to set root directory to public so when user will type the address of my site into his browser, for example: www.mysite.com he will actually open index.php from public directory not from / directory having this way no access to logs, includes, etc. I hope you know what I mean. Please reply ASAP:)

Cheers
imkingdavid
You could simply make a .htaccess file in your root / directory as follows:
CODE
<Files file.html>
order deny,allow
deny from all
</Files>

And just alter "file.html" to the file name. That way no one can access the file via the browser, but you can still get to it with FTP and such.
That's the easiest way to do what you're describing, if I'm not understanding incorrectly.
l245c4l
Thanks for the reply:)

So there is no way to set DocumentRoot path as I can in local apache configuration?
Using .htaccess, can I disallow users from accessing directories aswell?

Cheers
xiaomao
QUOTE(l245c4l @ Nov 16 2009, 01:04 AM) *
Thanks for the reply:)

So there is no way to set DocumentRoot path as I can in local apache configuration?
Using .htaccess, can I disallow users from accessing directories aswell?

Cheers



Try Apache Rewrite
NaRzY
If you want to make a file the root document, add this to your .htaccess file.
CODE
DirectoryIndex page.html

Where page.html equals the page you wish to use as your index.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.