using htaccess to move stuff offsite

Discussion in 'HTML' started by Marty Fremen, Jun 14, 2008.

  1. Marty Fremen

    Marty Fremen Guest

    I want to relocate images to another server to save bandwidth on our main
    domain hosting. Rather than altering the html files, I was thinking of just
    putting a .htaccess in our /images/ directory:

    RewriteEngine on
    RewriteRule ^(.+) http://www.example.com/images/$1

    I'm assuming this will cause files that would originally have been got from
    the images directory to instead be fetched from the external site, but am
    wondering if the redirect will itself consume bandwidth. I've not done
    htaccess type stuff before, am I right in assuming the amended url goes
    back to the browser which then fetches it for itself, and that apache
    doesn't actively proxy the requested file?
     
    Marty Fremen, Jun 14, 2008
    #1
    1. Advertising

  2. Marty Fremen

    Marty Fremen Guest

    "Safalra (Stephen Morley)" <> wrote:
    > You need to stick an [R=301] on the end (or [R=302] if you only want a
    > temporary redirect). This will cause the server to send a 301 (or 302)
    > response to the client with the rewritten address. Proxying is only done
    > with a [P] on the end.


    Thanks, I'll try using [R].
     
    Marty Fremen, Jun 15, 2008
    #2
    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. Rick Spiewak
    Replies:
    1
    Views:
    433
    Rick Spiewak
    Jul 22, 2003
  2. Jenny
    Replies:
    2
    Views:
    686
  3. Noel S Pamfree

    Can you insert a graphic offsite?

    Noel S Pamfree, Dec 12, 2005, in forum: HTML
    Replies:
    39
    Views:
    936
  4. Replies:
    1
    Views:
    530
    BootNic
    Mar 24, 2006
  5. SWT
    Replies:
    0
    Views:
    267
Loading...

Share This Page