473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.htaccess issue

hi everyone
is it possible to point images to another website ?
i mean for example:

this domain doesn't host the image > http://domain1.com/image.gif

this domain host the image > http://domain2.com/image.gif

i want when i request ( http://domain1.com/image.gif ) it's point to the image on domain2

is it possible by htaccess ?
Feb 26 '10 #1
6 1480
drhowarddrfine
7,435 Expert 4TB
Yes and I'll show how later today if no one else does.
Feb 26 '10 #2
thanks dear drhowarddrfine

i hope it would be something like , domain1.com = domain2.com ,,, means any file requested will be point to it in domain2.com , and i hope it works with embeding , such like <img src" ....

i'm waiting your reply .....

Thanks
Feb 26 '10 #3
drhowarddrfine
7,435 Expert 4TB
I'm out of town and having trouble remembering how to do this or what the best way might be. At first I was going to suggest this:
Expand|Select|Wrap|Line Numbers
  1. RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.othersite.com/ [
  2. R,NC]
Which states that any file requests ending with a (.) and a jpg,jpeg, etc file extension should be rewritten to the other site but I can't recall if/how you can rewrite the last part to include the file name. So probably a redirect is in order and that's where I'm having trouble remembering what to do.

EDIT:
Try this:
Expand|Select|Wrap|Line Numbers
  1. RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
  2. RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://domain2.com/$1 [R,NC]
  3.  
Feb 26 '10 #4
thanks for reply
it point to the domain with extension but without the filename
for example:
when i request domain1.com/image.gif it's point to domain2.com/gif
Feb 26 '10 #5
hello ??
any help please ?
Feb 28 '10 #6
drhowarddrfine
7,435 Expert 4TB
Sorry. Out of town till Monday.
Feb 28 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yawnmoth | last post by:
i'm trying to write a php script that will password protect some random directory by creating a .htaccess file, and a password file to accompany the .htaccess file, and it isn't working... ...
8
by: Joshua Beall | last post by:
Hi All, How do I disable magic quotes via .htaccess? I put the following file in my webroot, but it does not disable magic_quotes_gpc (according to phpinfo(), both the local and master value...
4
by: Ivo | last post by:
Greetings newsgroup, I am moving some php scripts to a new host. While getting to know the server, I ran into a strange problem. If I add a .htaccess file, or more specifically: a .htaccess with...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
0
by: Jack Hambabo | last post by:
Hi, I'm searching for a php script that can find out whether the current user (I know _SERVER will give me the name for non-cgi php) has the right to view a specific file. My dream is that I...
1
by: nickyeng | last post by:
I have checked this info from apache website, and i confused with it. Procteing System files it said: To run a really tight ship, you'll want to stop users from setting up .htaccess files...
0
by: xiaawan | last post by:
Hi All, Can Anyone help me to solve this problem. Actually I have two urls and I want both of them to work at the same time for different urls. here is my .htaccess code. AddHandler...
9
by: invertigo | last post by:
Hello, Im using this .htaccess file to rewrite my websites URL. Reason i try to do this is to make it more SEO friendly. Code: -------------------------------------------------------- Options...
8
by: Thiago Macedo | last post by:
Hi folks, I have the Apacha server (2.2.8) with PHP installed as CGI Binary. This, as i'm discovering, means that I can't change php configurations through .htaccess. Is my searches right or...
4
by: adnanjunk | last post by:
Hi, Having a little issue with .htaccess not working on windows server. I have clean url's setup using the htaccess file, working fine on linux server. I have researched for a while and found...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.