ereg_replace to Mask the URL?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
trmoser
Forum Newbie
Posts: 1
Joined: Wed Nov 08, 2006 1:17 pm

ereg_replace to Mask the URL?

Post 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;
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply