GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php url formatting question (https://gfy.com/showthread.php?t=127999)

mrthumbs 04-24-2003 04:26 PM

php url formatting question
 
www.domain.com
whatever.domain.com
domain.com

Is there a simple php command that
will strip all the bullshit out
and return:

domain.com

as output?

PowerCum 04-24-2003 04:39 PM

PHP Code:

<?php

$myhost
="doamin.com";

$host=$_SERVER["HTTP_HOST"];
$tmp=parse_url($host);
$scheme=$tmp[scheme]; 
$path=$tmp[path];
$query=$tmp[query];
$host=$tmp[host];
if (
$host!=$myhost){
$url=($scheme."://".$myhost.$path.$query);
header("Location: $url");
}

?>

That will redirect all the stuff with no ptoblems

Hope this will help you

mrthumbs 04-24-2003 04:47 PM

gracias! Going to test it now!

:thumbsup


All times are GMT -7. The time now is 04:33 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123