LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > blocking access to files and ORG_REQ_URI

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2008, 07:53 PM
tatsuhi tatsuhi is offline
New Member
 
Join Date: Jun 2008
Posts: 3
Question blocking access to files and ORG_REQ_URI

I am trying to block access to a directory containing files which I want to use internal redirect to deliver.

I tried placing this line in the rewrite rules for the Rails virtual host:

Code:
RewriteCond %{ORG_REQ_URI} ^/aaadownloads/
RewriteRule ^/aaadownloads/ - [R=403,F]
But it appears to do nothing. The files are still displayed or missing files show a 404.

I also tried turning on .htaccess overrides (for FileInfo) for the server, virtual host, and rails context, and putting that rule in a .htaccess in the directory - but it has no effect either.

Any ideas?
Or is there a way to use internal redirect without placing the files in a publicly accessible directory (even with the rewrite rule I'm a little afraid to put that in public)...

Thanks for any help
Reply With Quote
  #2  
Old 06-19-2008, 07:40 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
If you put the rewrite rule in .htaccess in that directory, you should use,


RewriteCond %{ORG_REQ_URI} ^/aaadownloads/
RewriteRule .* - [R=403,F]


"/aaadownloads/" has been chopped off as rewrite base.
Reply With Quote
  #3  
Old 06-21-2008, 02:02 PM
tatsuhi tatsuhi is offline
New Member
 
Join Date: Jun 2008
Posts: 3
Update: thanks, got it to work by placing that rule in the rails context and forgetting about the .htaccess files

Perhaps it would be nice to be able to serve internal redirects for files that aren't in /public...

Last edited by tatsuhi; 06-21-2008 at 02:15 PM..
Reply With Quote
  #4  
Old 06-21-2008, 09:18 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
Originally Posted by tatsuhi View Post
Perhaps it would be nice to be able to serve internal redirects for files that aren't in /public...
Should not be a problem, just define a "static" context pointing to a directory anywhere you want. It is just like Apache's "Alias" directive.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:55 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.