views:

143

answers:

2

Hello.

I am trying to lock a client out of a PHP application I created them but, still allow them a "virtual" access to the doc root using:

RewriteCond %{DOCUMENT_ROOT}/ftp/%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/ftp/%{REQUEST_URI} -d
RewriteRule ^(.+) /ftp/$1 [L]

This works like a charm when a user goes to: http://domain.com/dir/, but going to http://domain.com/dir causes a the browser url field to display a http://domain.com/ftp/dir/ which makes me sad.

Any ideas as to why?

A: 

Try removing the leading slash from the RewriteRule

RewriteRule ^(.+) ftp/$1 [L]
AWinter
That didn't work. Thanks for trying though.
J.Milly
Do you have any other rules that might be causing the issue? Is the file your redirecting to a dynamic file that might be doing a redirect it self? I set up a test environment and your rules seem to work correctly.
AWinter
A: 

This behavior can be caused by DirectorySlash. Try to disable it.

Gumbo
Interesting, when turned DirectorySlash is turned off, the redirect works but DirectoryIndex is being ignored. Any idea on a solution to this?Cheers
J.Milly