Forwarding Files

Forwarding Files

am 29.06.2007 18:25:14 von Randy Yates

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

Re: Forwarding Files

am 29.06.2007 18:35:11 von Andy Dingley

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.

Re: Forwarding Files

am 29.06.2007 19:35:18 von Shion

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

Re: Forwarding Files

am 29.06.2007 21:04:11 von Jon Slaughter

"J.O. Aho" wrote in message
news:5eku6uF37kjdvU1@mid.individual.net...
> 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...

Re: Forwarding Files

am 29.06.2007 21:33:24 von Randy Yates

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

Re: Forwarding Files

am 29.06.2007 21:47:57 von Shion

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