Page 1 of 1

ereg_replace to Mask the URL?

Posted: Wed Nov 08, 2006 1:28 pm
by trmoser
Currently I am running a server from home. (hopefully only for another month or so..) I have tried a few different DNS servers and most of them will cloak or mask the URL. But... when this is done it fubars up all of the html presented to the search engines.

I have been looking for a way to mask it in my php. So far this is where i am and it doesn't work... (of course) the last line is NOT RIGHT AT ALL :roll:

Anybody have a guess?

Code: Select all

<?php
$url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
ereg_replace( "70.190.143.157:81", "www.monoloc.net", $url );
$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] = $url;
?>

Posted: Thu Nov 09, 2006 12:04 am
by feyd
Wouldn't str_replace() work faster as your pattern contains no actual patterns? I'm not sure what you're trying to do however. Giving a URL to ereg or most other functions won't pull the information from that page, if that is what you're trying to do. You will need file_get_contents(), some sibling or a cousin to pull remote page data.