There should be a quick one or 2 line solution. All I want is if someone ever comes to the page via http://www.domain.com that it automatically changes the location header to be domain.com (takes out the www)
1/5/2006 3:02:27 PM
this is a google question - not tww
1/5/2006 3:06:13 PM
Fuck you. I asked google already.
1/5/2006 3:22:37 PM
oops[Edited on January 5, 2006 at 4:51 PM. Reason : ]
1/5/2006 4:49:47 PM
header("Location: " . preg_replace("/^w ww./", "", "http://www.google.com"));
1/5/2006 5:16:39 PM
hah. thx.
1/5/2006 5:17:53 PM
^^That won't work. The w isn't at the beginning of the string.If you want something quick and dirty:
header("Location: " . preg_replace("/\/[w]{3}\./", "", "http://www.domain.com");
1/5/2006 5:48:25 PM
oops, i had the search string as ^http://www but tww inserted the link tags and i must have removed the http part while trying to fix it.mod_rewrite is an apache solution, not a php solution (not all web servers use apache)but yeah, there are lots of ways to do this[Edited on January 5, 2006 at 6:25 PM. Reason : tww sucks][Edited on January 5, 2006 at 6:38 PM. Reason : though i prolly could have escaped the period]
1/5/2006 6:24:51 PM