.htaccess question

M

Michael Weber

Hi Bart,

[Mon, 15 Sep 2003 21:40:46 +0200/Bart van den Burg]
i wish to redirect requests on a certain directory to 1 file in there, and
use the file requested as a parameter
(eg. http://www.tvreclames.nl/clips/somefile.mpg?sessionID=4324FGD34sa ->
http://www.tvreclames.nl/clips/download.pl?sessionID=4324FGD34sa&file=somefile.mpg)

Is this possible, and if yes: How do i do this?

Put a .htaccess to your _root_, containig

Redirect /video http://www.whatever.com/video/videoxy.mpg

A client who is calling "www.whatever.com/video" will get the mpg
in /video.

Always use absolute paths for redirecting.

regs
michael
 
B

Bart van den Burg

Michael Weber said:
Hi Bart,

[Mon, 15 Sep 2003 21:40:46 +0200/Bart van den Burg]
i wish to redirect requests on a certain directory to 1 file in there, and
use the file requested as a parameter
(eg. http://www.tvreclames.nl/clips/somefile.mpg?sessionID=4324FGD34sa ->
http://www.tvreclames.nl/clips/download.pl?sessionID=4324FGD34sa&file=somefile.mpg)

Is this possible, and if yes: How do i do this?

Put a .htaccess to your _root_, containig

Redirect /video http://www.whatever.com/video/videoxy.mpg

A client who is calling "www.whatever.com/video" will get the mpg
in /video.

Always use absolute paths for redirecting.

Actually, that wasn't exactly what i was trying to achieve, but I have
finally figured it out anyway :)

say for instance I was calling:
http://www2.tvreclames.nl/somevideo.mpg?sessionID=P2YvgcCoASgAAA4CF-c

I had the .htaccess like this:
RewriteEngine On
RewriteRule ([^.]*\.mpg) http://www2.tvreclames.nl/download.pl?file=$1

Refering me to:
http://www2.tvreclames.nl/download.pl?file=somevideo.mpg
(I took it out of the clips dir, since it's in fact only 1 file)

This still didn't give me the sessionID, which I just fetched with perl
using $ENV{REQUEST_URI}

Quite a nice learning process, since before trying this, I knew nothing of
..htaccess :)

Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HTACCESS - prevent files from being downloaded via 'view source' 1
.htaccess 2
.htaccess 2
.htaccess - htm / html question 3
Coding Question - Looking for Help 4
htaccess ? 2
htaccess question... 3
Song Request 5

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top