In my PHP code I've got references to a URL on another website. I'm testing my website locally (using XAMPP). Is it possible to get Apache to automatically replace the domain of this other website for localhost?
For example my PHP code might be:
<?php echo "<a href='http://www.othersite.com'>Click me</a>"; ?>
And I'd like for my local Apache to alias this to
<?php echo "<a href='http://localhost'>Click me</a>"; ?>
Is this possible?
[edit] Just to clarify, I want to do this without changing PHP code. Might not be possible, but thought it worth asking as it would make testing locally simpler without having to have hacks in the PHP code.
Cheers, Dan.