Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Forwarding Files

Reply
Thread Tools

Forwarding Files

 
 
Randy Yates
Guest
Posts: n/a
 
      06-29-2007
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 %
%%%% <(E-Mail Removed)> % 'Yours Truly, 2095', *Time*, ELO
http://home.earthlink.net/~yatescr
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      06-29-2007
On 29 Jun, 17:25, Randy Yates <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
 
J.O. Aho
Guest
Posts: n/a
 
      06-29-2007
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
 
Reply With Quote
 
Jon Slaughter
Guest
Posts: n/a
 
      06-29-2007

"J.O. Aho" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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...


 
Reply With Quote
 
Randy Yates
Guest
Posts: n/a
 
      06-29-2007
Andy Dingley <(E-Mail Removed)> writes:

> On 29 Jun, 17:25, Randy Yates <(E-Mail Removed)> 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 %
%%%% <(E-Mail Removed)> % 'Living' Thing', *A New World Record*, ELO
http://home.earthlink.net/~yatescr
 
Reply With Quote
 
J.O. Aho
Guest
Posts: n/a
 
      06-29-2007
Randy Yates wrote:
> Andy Dingley <(E-Mail Removed)> writes:
>
>> On 29 Jun, 17:25, Randy Yates <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
forwarding Args&&... vs forwarding Args... Andrew Tomazos C++ 5 01-05-2012 11:15 PM
how i can extract text from the PDF files,power point files,Ms word files? crazyprakash Java 4 10-30-2005 10:17 AM
Text files read multiple files into single file, and then recreate the multiple files googlinggoogler@hotmail.com Python 4 02-13-2005 05:44 PM
python, mbox files and forwarding messages Brad Tilley Python 2 10-28-2004 06:16 PM
Help! Files, Files, and more Files ... Everywhere JeffS Digital Photography 22 09-19-2004 01:47 AM



Advertisments