.htaccess question

Discussion in 'HTML' started by Bart van den Burg, Sep 15, 2003.

  1. Bart van den Burg, Sep 15, 2003
    #1
    1. Advertising

  2. Hywel Jenkins, Sep 15, 2003
    #2
    1. Advertising

  3. 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
     
    Michael Weber, Sep 15, 2003
    #3
  4. "Michael Weber" <> wrote in message
    news:...
    > 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
     
    Bart van den Burg, Sep 16, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuël van Laere

    Charset - htaccess question

    Samuël van Laere, Jul 9, 2003, in forum: HTML
    Replies:
    9
    Views:
    3,579
    T. Audry Glamour
    Jul 9, 2003
  2. mentalguy2004

    htaccess question...

    mentalguy2004, Aug 24, 2004, in forum: HTML
    Replies:
    3
    Views:
    436
    lostinspace
    Aug 24, 2004
  3. nllamas

    .htaccess - htm / html question

    nllamas, Apr 1, 2006, in forum: HTML
    Replies:
    3
    Views:
    568
    nllamas
    Apr 1, 2006
  4. BusyGuy

    .htaccess question please

    BusyGuy, Sep 21, 2006, in forum: HTML
    Replies:
    6
    Views:
    530
    Jukka K. Korpela
    Sep 23, 2006
  5. Adrienne Boswell

    htaccess Question

    Adrienne Boswell, Jun 20, 2009, in forum: HTML
    Replies:
    2
    Views:
    403
    Adrienne Boswell
    Jun 20, 2009
Loading...

Share This Page