Forwarding Files

Discussion in 'HTML' started by Randy Yates, Jun 29, 2007.

  1. Randy Yates

    Randy Yates Guest

    Hi Folks,

    Is there a way to have a reference to, say, http://mysite1.org/file1.pdf to
    be "forwarded" to http://mysite2.org/file2.pdf? I know I could write a cgi
    script to reside on mysite1 to do this - I was wondering if there was a
    "simpler," more html-centric way.
    --
    % Randy Yates % "She has an IQ of 1001, she has a jumpsuit
    %% Fuquay-Varina, NC % on, and she's also a telephone."
    %%% 919-577-9882 %
    %%%% <> % 'Yours Truly, 2095', *Time*, ELO
    http://home.earthlink.net/~yatescr
     
    Randy Yates, Jun 29, 2007
    #1
    1. Advertising

  2. Randy Yates

    Andy Dingley Guest

    On 29 Jun, 17:25, Randy Yates <> wrote:

    > Is there a way to have a reference to, say,http://mysite1.org/file1.pdfto
    > be "forwarded" tohttp://mysite2.org/file2.pdf?


    Host on Apache

    Configure this in .htaccess with a 301 or 302 (temporary) redirect.

    Easy.


    Search the group archives on mapping one domain onto another, for the
    whole site. It's a fairly common question.
     
    Andy Dingley, Jun 29, 2007
    #2
    1. Advertising

  3. Randy Yates

    J.O. Aho Guest

    Randy Yates wrote:
    > Hi Folks,
    >
    > Is there a way to have a reference to, say, http://mysite1.org/file1.pdf to
    > be "forwarded" to http://mysite2.org/file2.pdf? I know I could write a cgi
    > script to reside on mysite1 to do this - I was wondering if there was a
    > "simpler," more html-centric way.


    Best is server side redirections, if you use a proper web server like apache
    you can do that.

    You can make a php file with the extension pdf, which redirects to the right
    file, but in that case you need to tell the web server to parse pdf files as
    php scripts, which will slow your system down to a crawl each time people
    access a real pdf file.

    So the first option is the best one.

    --

    //Aho
     
    J.O. Aho, Jun 29, 2007
    #3
  4. "J.O. Aho" <> wrote in message
    news:...
    > Randy Yates wrote:
    >> Hi Folks,
    >>
    >> Is there a way to have a reference to, say, http://mysite1.org/file1.pdf
    >> to
    >> be "forwarded" to http://mysite2.org/file2.pdf? I know I could write a
    >> cgi
    >> script to reside on mysite1 to do this - I was wondering if there was a
    >> "simpler," more html-centric way.

    >
    > Best is server side redirections, if you use a proper web server like
    > apache
    > you can do that.
    >
    > You can make a php file with the extension pdf, which redirects to the
    > right
    > file, but in that case you need to tell the web server to parse pdf files
    > as
    > php scripts, which will slow your system down to a crawl each time people
    > access a real pdf file.
    >


    Except in the rar case that the pdf actually contains data that could be
    parsed as php code...
     
    Jon Slaughter, Jun 29, 2007
    #4
  5. Randy Yates

    Randy Yates Guest

    Andy Dingley <> writes:

    > On 29 Jun, 17:25, Randy Yates <> wrote:
    >
    >> Is there a way to have a reference to, say,http://mysite1.org/file1.pdfto
    >> be "forwarded" tohttp://mysite2.org/file2.pdf?

    >
    > Host on Apache
    >
    > Configure this in .htaccess with a 301 or 302 (temporary) redirect.
    >
    > Easy.


    I think I can do that - I have a VM hosted web account where I think I
    "own" my own httpd.

    > Search the group archives on mapping one domain onto another, for the
    > whole site. It's a fairly common question.


    I only wanted certain files within the "mysite1" domain to operate this way,
    not all on the entire domain.
    --
    % Randy Yates % "Rollin' and riding and slippin' and
    %% Fuquay-Varina, NC % sliding, it's magic."
    %%% 919-577-9882 %
    %%%% <> % 'Living' Thing', *A New World Record*, ELO
    http://home.earthlink.net/~yatescr
     
    Randy Yates, Jun 29, 2007
    #5
  6. Randy Yates

    J.O. Aho Guest

    Randy Yates wrote:
    > Andy Dingley <> writes:
    >
    >> On 29 Jun, 17:25, Randy Yates <> wrote:
    >>
    >>> Is there a way to have a reference to, say,http://mysite1.org/file1.pdfto
    >>> be "forwarded" tohttp://mysite2.org/file2.pdf?

    >> Host on Apache
    >>
    >> Configure this in .htaccess with a 301 or 302 (temporary) redirect.
    >>
    >> Easy.

    >
    > I think I can do that - I have a VM hosted web account where I think I
    > "own" my own httpd.
    >
    >> Search the group archives on mapping one domain onto another, for the
    >> whole site. It's a fairly common question.

    >
    > I only wanted certain files within the "mysite1" domain to operate this way,
    > not all on the entire domain.


    Redirecting in Apache is quite simple, you can do that with regular
    expressions or give the full path.

    full paths:
    RewriteEngine on
    RewriteRule file1.pdf http://mysite2.org/file2.pdf

    reg-expression:
    RewriteEngine on
    RewriteRule ^(/[c|d]/winnt/.*) http://127.0.0.1/$1


    --

    //Aho
     
    J.O. Aho, Jun 29, 2007
    #6
    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. Eqbal Z
    Replies:
    1
    Views:
    1,303
  2. Navic
    Replies:
    2
    Views:
    2,661
  3. Binod Nair

    URL Forwarding Problem

    Binod Nair, Jan 22, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,990
    Binod Nair
    Jan 22, 2004
  4. Brad Tilley
    Replies:
    2
    Views:
    665
    Jorgen Grahn
    Oct 28, 2004
  5. Andrew Tomazos
    Replies:
    5
    Views:
    632
Loading...

Share This Page