title: Load another domain images to my domain using htaccess?
body: <p>I have 2 domains and 2 servers <strong><code>example.com</code></strong> and <strong><code>example2.com</code></strong>. for eg: <strong><code>example.com</code></strong> is my main domain. i upload my site images into <strong><code>example2.com</code></strong></p>
  
  <p>my current image path <code>http://example.com/data/photos/sample.jpg</code>.<br>
  but my all images are in <code>http://example2.com/data/photos/sample.jpg</code></p>
  
  <p>So i create htaccess <strong>301</strong> redirect </p>
  
  <pre><code>RewriteEngine on
  RewriteBase /
  RewriteRule ^data/photos/(.*)$ http://example2.com/data/photos/$1 [R=301]
  </code></pre>
  
  <p>But its not working for me. Because of i called full URL into my all pages. so any one suggestion its very helpful for me</p>
  
  <p><strong>Updated</strong> my old Htaccess file</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  
  RewriteEngine On
  
  RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?%{QUERY_STRING} [NE,L]
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  RewriteEngine On
  RewriteBase /
  RewriteRule ^data/photos/(.*)$ http://example2/data/photos/$1 [R=301]
  &lt;/IfModule&gt;
  </code></pre>