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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > Context support for AliasMatch?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2008, 08:13 AM
nutz nutz is offline
New Member
 
Join Date: Feb 2008
Posts: 9
Question Context support for AliasMatch?

Hi,

I am trying to redirect an entire directory to a single file. With Apache, I used this:
Code:
AliasMatch ^/dir /path/to/file
I tried setting a "Static" Context like this:
Code:
URI = exp:^/dir
Location = $VH_ROOT/file
Accessible = Yes
"file" is in the virtual host root directory, but it isn't working. I also tried adding "(.*)" and "(.*)$" to the URI, with no effect.

If I change the Context to this:
Code:
URI = /dir/
Location = $VH_ROOT/file
Accessible = Yes
Then it works, but only for "/dir/", not "/dir/x".

Looking at the debug log with the first Context, I see these lines:
Code:
File not found [/.../dir/x]
processContextPath() return 25
processNewReq() return 25.
HttpConnection::sendHttpError(),code=404 Not Found
Does that give any clues?

Thanks.
Reply With Quote
  #2  
Old 02-26-2008, 09:28 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Please try

Quote:
URI = exp:^/dir
Location = /absolute/path/to/file
Accessible = Yes
Reply With Quote
  #3  
Old 02-26-2008, 09:45 AM
nutz nutz is offline
New Member
 
Join Date: Feb 2008
Posts: 9
Unfortunately, that has the same result and log entries.

Btw, I am now using 3.3.5 (was using 3.3.4 at first).
Reply With Quote
  #4  
Old 02-26-2008, 10:55 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
what's in the debug log?
Reply With Quote
  #5  
Old 02-26-2008, 01:31 PM
nutz nutz is offline
New Member
 
Join Date: Feb 2008
Posts: 9
Here is the debug logging:
Code:
2008-02-26 21:25:50.249 [NOTICE] [...] Content len: 0, Request line: 
GET /dir/x HTTP/1.1
2008-02-26 21:25:50.249 [DEBUG] [...] Find .htaccess context with URI: [/], location: [/path/to/docroot/]
2008-02-26 21:25:50.249 [DEBUG] [...] File not found [/path/to/docroot/dir/x] 
2008-02-26 21:25:50.249 [DEBUG] [...] processContextPath() return 25
2008-02-26 21:25:50.249 [DEBUG] [...] processNewReq() return 25. 
2008-02-26 21:25:50.249 [DEBUG] [...] HttpConnection::sendHttpError(),code=404 Not Found
2008-02-26 21:25:50.249 [DEBUG] [...] HttpConnection::flush()!
2008-02-26 21:25:50.250 [DEBUG] [...] Written to client: 637
2008-02-26 21:25:50.250 [DEBUG] [...] HttpConnection::nextRequest()!
Let me know if you need any additional info.
Reply With Quote
  #6  
Old 02-26-2008, 03:41 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
I think you have "/" context defined, so the order of contexts are important. You need change the sequence number of the regex context, make it smaller than that of "/" context.
Reply With Quote
  #7  
Old 02-27-2008, 01:25 PM
nutz nutz is offline
New Member
 
Join Date: Feb 2008
Posts: 9
I don't have any "/" Context (or redirect), but I think I have found the trigger now! The problem happens if there are any "RedirectMatch" directives in the .htaccess file (plain "Redirect" are OK).
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 05:09 AM.



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