Page 1 of 1

Changing base uri for relative paths

Posted: Tue Feb 17, 2009 8:35 am
by osita
Hello,

Sorry for my newbie question, but I don't know how to do this.

I need the relative paths of certain content to point to http://server2/
For example, if I have

Code: Select all

<script type="text/javascript" src="../test.js"></script>
this should be relative on http://server2 instead of http://server1 (my actual url is http://server1)

I want to do this because before changing the source of an iframe I am processing the file and then printing the content inside...but fails when it tries to include other scripts because of the relative paths trying to load from server1..

Is this possible? Thanks!

Re: Changing base uri for relative paths

Posted: Tue Feb 17, 2009 6:59 pm
by LanceEh
Take a look at $_SERVER['PHP_SELF'] Don't know if this is what you need but it might work.

Re: Changing base uri for relative paths

Posted: Wed Feb 18, 2009 3:07 am
by osita
Thanks for your reply..finally what I want it is possible modifying the .htaccess in APACHE and adding redirecting rules :D