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

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > mod_headers/files compatibility

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2008, 04:33 PM
IrPr IrPr is offline
Senior Member
 
Join Date: Jul 2008
Posts: 147
Default mod_headers/files compatibility

Hi there
I've planned to force WMV files to be downloaded instead of stream by Windows Media Player in some IE browsers without Download Managers

should add some special response Headers when it requests WMV files
This is my Apache configuration which works charmly:
Code:
<Files "\.(wmv|WMV)$">  
  Header add Content-Description "File Transfer"
  Header add Content-Type        "video/x-ms-wmv"
  Header add Content-Disposition "attachment"
</Files>
But when i add this into LSWS Apache Style configurations doesnt work properly
no any extra response headers will be added

Whats wrong? something with my configurations? or it doesnt support Files or Header directives?

Thanks LSWS Developers, specially Geroge that i know he will answer n probably solve this issue

Last edited by IrPr; 07-26-2008 at 04:49 PM..
Reply With Quote
  #2  
Old 07-26-2008, 04:44 PM
IrPr IrPr is offline
Senior Member
 
Join Date: Jul 2008
Posts: 147
Edit:
I've tried SetEnvIf instead, but still same problem, no header will be added
Code:
SetEnvIf Request_URI "\.wmv$" requested_wmv=wmv 
Header add Content-Description "File Transfer" env=requested_wmv 
Header add Content-Disposition "Attachment"    env=requested_wmv
Seems to be Header directive incompatibility to me, but it supports, George said here

PS: i dont restart whole LSWS, just gracefully restart, aint need inital daemon restart to apply?

Last edited by IrPr; 07-26-2008 at 04:50 PM..
Reply With Quote
  #3  
Old 07-28-2008, 05:45 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
The configuration in the first post should work with latest 3.3.16 build. The "Header" directive was not supported.
Reply With Quote
  #4  
Old 07-29-2008, 02:52 AM
IrPr IrPr is offline
Senior Member
 
Join Date: Jul 2008
Posts: 147
Thanks George
I've upgraded to latest 3.3.16 release but still not workin properly
Reply With Quote
  #5  
Old 07-29-2008, 11:46 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Try header add in .htaccess, if the whole directory hold wmv, get rid of the "<files...>"
Reply With Quote
  #6  
Old 07-29-2008, 12:59 PM
IrPr IrPr is offline
Senior Member
 
Join Date: Jul 2008
Posts: 147
Quote:
Originally Posted by mistwang View Post
Try header add in .htaccess, if the whole directory hold wmv, get rid of the "<files...>"
Ok, Thanks
i will test and reply
Reply With Quote
  #7  
Old 07-30-2008, 03:05 AM
IrPr IrPr is offline
Senior Member
 
Join Date: Jul 2008
Posts: 147
Quote:
Originally Posted by mistwang View Post
Try header add in .htaccess, if the whole directory hold wmv, get rid of the "<files...>"
Header directive in htaccess is working well:

.htaccess:
Code:
Header add Content-Description "File Transfer"
#Header add Content-Type       "video/x-ms-wmv"
Header add Content-Disposition "attachment"
Request:
Code:
GET /test/wmv HTTP/1.1
Host: localhost
Response header:
Code:
HTTP/1.1 200 OK
Date: Wed, 30 Jul 2008 09:58:12 GMT
Server: LiteSpeed
Accept-Ranges: bytes
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
ETag: "a6eb915-4804c40d-1cc8118"
Last-Modified: Tue, 15 Apr 2008 15:04:45 GMT
Content-Type: application/octet-stream
Content-Length: 175028501
Content-Description: File Transfer
Content-Disposition: attachment
But no way to set any condition, <Files> or SetEnfIf
would be implemented please?

PS: Files directive isnt supported in htaccess files by httpd, just global/vh configurations
Reply With Quote
  #8  
Old 07-30-2008, 10:40 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
<Files> should work in .htaccess as well.
Reply With Quote
  #9  
Old 07-31-2008, 04:11 PM
IrPr IrPr is offline
Senior Member
 
Join Date: Jul 2008
Posts: 147
Thanks for reply, but still doesnt work properly with Files directive

This is my .htaccess, setting both REGEX and PLAIN conditions
Code:
<Files "\.(wmv|WMV)$">
  Header add Content-Description "File Transfer"
#  Header add Content-Type        "video/x-ms-wmv"
  Header add Content-Disposition "attachment"
</Files>
<Files "*.wmv">
  Header add Content-Description "File Transfer"
#  Header add Content-Type        "video/x-ms-wmv"
  Header add Content-Disposition "attachment"
</Files>
While this .htaccess adds headers for all of requests
Code:
Header add Content-Description "File Transfer"
#Header add Content-Type        "video/x-ms-wmv"
Header add Content-Disposition "attachment"

Last edited by IrPr; 07-31-2008 at 04:16 PM..
Reply With Quote
  #10  
Old 08-01-2008, 03:34 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Fixed, please download 3.3.16 package again.
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 11:57 PM.



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