|
-
Oct 15th, 2007, 03:33 AM
#1
Thread Starter
Lively Member
[RESOLVED] Rewriting content on the fly
Hello there,
I have what may look as a strange request.
I have to change the content of a webpage hosted on Apache, without actually changing the file. The webpage can be a .php, .html or .htm.
What I want to do is to rewrite the url of the images it contains, so they point to another location. For instance, imagine this is part of the original content:
<img src="images/logo.jpg" alt="Company logo" />
I have to rewrite the src value, and make it look like this:
<img src="http://whatever.anotherdomain.com/images/logo.jpg" alt="Company logo" />
For a reason I won't explain (long story), I can't just open the page and modify the src attribute manually. It has to be done by a script, either a Javascript or other method.
Even if I'm able to accomplish this via Javascript, I'm looking for another solution because if the user disables javascript, the src value is not rewritten.
My question:
Can I do this with an .htaccess rule? How?
If not, are there other options?
Many Thanks in advance. 
edit: I suddenly remembered that I can add the <base> tag to the page instead of rewriting all the SRCs, and get the same result. The question is still there: how do I add that tag on the fly?
Last edited by BrightSoul; Oct 15th, 2007 at 03:43 AM.
- mo! I said MOOOOOOO!!
- ...yep, that's a cow, alright.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|