PDA

View Full Version : different header depending on what url website is typed in?


Relientk
08-19-2012, 05:14 AM
I was wondering if any one knows if there is a mod or some way that you can have a different header/logo show up depending on the url that is typed in.

For example-

You are using ONE database the SAME forum. But you have TWO url's that go to this ONE forum. So for example you have siteone.com and sitetwo.com its the same site but when url siteone.com is the url typed in the address bar it will load the graphic/header that says siteone.com and then vise versa if sitetwo.com was typed in.

I seen this mod that will load different banners according to the time- https://vborg.vbsupport.ru/showthread.php?t=236726 basically that's what I'd like to do but for it to change for whatever domain.com/url is typed in.

I appreciate any help! Thank you!

Black Snow
08-19-2012, 11:13 AM
You would just grab the current page URL using something like this:
<?php
$current_page_URL = $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
?>

Here $_SERVER["SERVER_NAME"] will give you the doman name of your site and $_SERVER["REQUEST_URI"] will give you the rest.

Example: https://vborg.vbsupport.ru/showthread.php?t=286829

$_SERVER["SERVER_NAME"] will give you vbulletin.org

$_SERVER["REQUEST_URI"] will give you /forum/showthread.php?t=286829

The do a check. <?php
if {$current_page_URL = xxx} Show banner 1
{else}
Show banner 2
?>

Relientk
08-19-2012, 04:21 PM
Thank you for the help! I'll give it a try and see if it works!

Relientk
08-21-2012, 05:24 AM
is there a way to-

If you go to sitetwo.com it still shows the url domain name sitetwo.com not siteone.com in the address bar on the browser.

--------------- Added 1345532388 at 1345532388 ---------------

Where do I make these changes?

<?php
$current_page_URL = $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
?>

I'm not sure where to find this to edit. Am I going to do this in the template? in the admin panel? or do I need to edit a file and upload it by ftp? Thank you!

--------------- Added 1345601758 at 1345601758 ---------------

I found what i was looking for thanks! https://vborg.vbsupport.ru/showthread.php?t=174381&highlight=more+than+one+domain+going+to+same+forum&page=3

Stefan118
08-22-2012, 10:26 PM
is there a way to-

If you go to sitetwo.com it still shows the url domain name sitetwo.com not siteone.com in the address bar on the browser.

This is set in your config of the parked domainname. (cloak)
You have forwarded sitetwo.com to siteone.com, and somewhere in that same option you can check or uncheck the cloak.