Forum Moderators: phranque

Message Too Old, No Replies

         

TheDoctor

7:48 pm on Aug 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm setting up a new site, with a new host. There's good reason to be with the host, but there's also a problem in that all the space I've got is accessible via the web - ie [widgets.com...] points to the root directory of my space, rather than a directory (eg public_html or the like) lower down.

What sort of advice do you have to protect directories that need to be inaccessible? I'm thinking of things such as data directories for a bulletin board. My host's technical support have been less than useful when I contacted them.

TheDoctor

5:11 pm on Aug 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So I decided to try mod_rewrite to point all browser requests to a directory called "web". This being the first time I've used it (the other site that I'm in charge of runs under Zeus, so I have to make do without mod_rewrite on that one), I've run into a bit of trouble.

What I've put into my .htaccess file is


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI}!./web(/.*¦$) [NC]
RewriteRule /(.*) /web/$1 [L]

This does something, but not what I want.

As it stands, an attempt to access the main my site gives me the document in the existing root. However, if I remove the / before the opening bracket in the rewrite rule I get a 404.

I don't understand this. Anyone able to enlighten me?

Also, am I even approaching the problem in the right way?