|
|

10-21-2012, 08:56 PM
|
|
New Member
|
|
Join Date: Oct 2012
Posts: 9
|
|
How to use X-Sendfile or X-Accel-Redirect in LiteSpeed 4.1.13
Dear Staff,
I've installed LSW 4.1.13 but i have a question is: How to use X-Sendfile or X-Accel-Redirect?
I've read your wiki at http://www.litespeedtech.com/support...ernal_redirect, and i try with code:
PHP Code:
<?
header("Content-type: application/java-archive");
header("X-Sendfile: HOT_GAME.jar");
?>
But download file is empty.
EX: My domain is: http://xinh.im, and direct download org file is http://xinh.im/HOT_GAME.jar , php file X-Sendfile is: http://xinh.im/t.php, when i download with http://xinh.im/t.php it response file is empty.
Please help me,
Last edited by b0ngma01; 10-21-2012 at 09:29 PM..
|

10-22-2012, 01:31 AM
|
|
New Member
|
|
Join Date: Oct 2012
Posts: 9
|
|
Quote:
Originally Posted by NiteWave
|
I've changed and you can see by click: http://xinh.im/t.php
But if don't have content type, it is error.
|

10-22-2012, 02:50 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,226
|
|
my local tests shows
PHP Code:
<?php
header("X-LiteSpeed-Location: /HOT_GAME.jar");
?>
works. will prompt you to down t.php
accessing domain.com/t.php is same to access domain.com/HOT_GAME.jar directly.
my tests also shows
header("Content-type: application/java-archive");
will be ignored. however, since the built-in MIME is "application/java-archive", so it does have a MIME type.
you can simply test it with
"curl -I domain.com/t.php" on a linux terminal.
Last edited by NiteWave; 10-22-2012 at 04:30 AM..
|

10-22-2012, 03:18 AM
|
|
New Member
|
|
Join Date: Oct 2012
Posts: 9
|
|
Quote:
Originally Posted by NiteWave
my local tests shows
PHP Code:
<?php
header("X-LiteSpeed-Location: /HOT_GAME.jar");
?>
works. will prompt you to down t.php
it's same behavior when you access domain.com/HOT_GAME.jar directory.
my tests also shows
header("Content-type: application/java-archive");
will be ignored. however, since the built-in MIME is "application/java-archive", so it does have a MIME type.
you can simply test it with
"curl -I domain.com/t.php" on a linux terminal.
|
Okay, i've got it 
Thank you so much!
|

10-22-2012, 04:36 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,226
|
|
there are 2 kinds of rewrite rules: per directory and per server.
the one you post is per server rule. in .htaccess, should use per directory.
in this case, please try following:
Code:
RewriteEngine On
RewriteCond %{ORG_REQ_URI} ^/data/
RewriteRule ^data/(.*) - [R=403,F]
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:46 PM.
|
|