Domain Redirection

Discussion in 'Apache' started by ExtremR, Jul 22, 2012.

  1. #1
    Hello guys,

    I've been trying to get it to run properly for past few hours but no luck. I've tried all kind of codes I found online.

    So I have images.website.com and I want to redirect all content of it to images.website.org (tld change).

    I manged to do the homepage redirect but my original images don't redirect to .org.

    Image URL: http://images.website.com/images/123.png

    Once users load that image directly in their browser I'd like it to point to http://images.website.org/images/123.png

    I'm using Apache and htaccess.

    Thanks guys!
     
    ExtremR, Jul 22, 2012 IP
  2. Ray Baron

    Ray Baron Member

    Messages:
    148
    Likes Received:
    10
    Best Answers:
    3
    Trophy Points:
    43
    #2
    Does the image actually exist on website.org? Or do you just want the browser URL to show website.org?
     
    Ray Baron, Jul 24, 2012 IP
  3. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #3
    Try adding the following lines to your .htaccess file:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^images.website.com$
    RewriteRule (.*)$ http://images.website.org/$1 [R=301,L]
     
    RoseHosting, Jul 25, 2012 IP