change instances of domains

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
prejudged_fire
Forum Newbie
Posts: 15
Joined: Sun Dec 18, 2005 6:28 pm

change instances of domains

Post by prejudged_fire »

Ok im not intirely sure if Im in the right place or not. What I want to do is make a website that displays the content of a webpage the user requests inside my webpage. viewtopic.php?t=42036&postdays=0&postorder=asc&start=15 go to that topic to see what im talking about. I was told to go here to find out how to change the instances of http://theirdomain.com to http://mydomain.com?request=http://theirdomain.com

I've gotten half way through. I have managed to display the content of the website the user inputs, however if the user clicks on a link of that webpage he/she leaves my website and goes to the other domain. How do I keep all of the content from a specified user chosen website on MY domain even when the user clicks on a link? I know there are several ways of doing this.. I need the easiest and simpilist.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

You can't.

If you could everyone would go to http://www.hawleyjr.com?=id=www.ebay.com

and send me money :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

He is referring to using cURL to capture the sites content and convert the links so he can navigate the pages without leaving his site.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

of which, there is no real "easy" way to do it.. and no 100% guaranteed way either, as links stored in javascript can easily create a problem.. you also have to be concious of how the links are encoded.. some may be full url, some only literal path, some relative.. each has to be parsed and "fixed" to the new url. Look for a thread created by Heavy a while ago where I responded with a code viewing script.. it has a lot of what you'll need built-in..
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Havn't we all missed feyd 8)
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Jcart wrote:Havn't we all missed feyd 8)
LOL, yeah I'm actually getting work done today :) :) Cheers Feyd.
Post Reply