Shadow Wolf Posted September 28, 2007 Posted September 28, 2007 This is a request from some of my clients that I admin and host IPB forums with. Recently one of them has had their work block all websites with "register" in the domain name. Unfortunately their forum is hosted in a subdomain of a website with register in it. They have blocked it by domain name and not IP as he can go to the IP address to view it, however IPB is looking for things based on domain name, not IP the css doesn't work properly, login doesn't work, etc. Is there something server side that I can do to reroute or bypass the issue for them? Or are they stuck either dealing with it or using a proxy server to bypass it?
bfarber Posted September 28, 2007 Posted September 28, 2007 One "hack" that would work. Have them modify their Windows hosts file and add something like mysite ip address here Then on the site check the "HTTP_HOST" server parameter - if set to mysite do a preg_replace (or str_replace) in class_display.php to change the real domain name to the fake one. Anyone else would be able to do this too, but they'd have to know the change existed to take advantage of it.
Shadow Wolf Posted October 1, 2007 Posted October 1, 2007 preg_replace ... something like:$string = 'mysitedomain'; $patterns = 'mysitedomain'; $replacements = 'fakename'; echo preg_replace($patterns, $replacements, $string); I haven't tried editing yet to test it though. Mainly because still not sure of the ramification of this. Will this effect the people who don't have their hosts files modified, aren't blocked, etc?
bfarber Posted October 2, 2007 Posted October 2, 2007 I'd go with something more like { // If we're here, they visited by requesting "fakedomain" so let's keep it that way $page_content = str_replace( "mysitedomain", "fakedomain", $page_content ); }if( strpos( $_SERVER['HTTP_HOST'], 'fakedomain' ) !== false )
Recommended Posts
Archived
This topic is now archived and is closed to further replies.