Forum Moderators: coopster
i have a <base href="" /> tag on all of my pages, which i fill in with php...
<?php echo'<base href="http://'.$_SERVER['HTTP_HOST'].''.$_SERVER['REQUEST_URI'].'" />';?> this code works absolutely fine, and i end up with something like this:
<base href="http://www.example.com/" /> the problem comes when people visit the site through http://example.com, rather than http://www.example.com.
because the base tag fills up with this...
<base href="http://example.com/" /> it's not much of a problem, granted, but i was wondering if there was a way to rewrite the above code so that it adds in the www.
or, even better, is there a way to rewrite the actual url itself just be using php?
or
http://www.example.com/
but not
http://example.com
i know i'm probably asking for the moon here