Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Different Domain, Different Style Details »»
Different Domain, Different Style
Version: 1.0.1, by dartho dartho is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.7.0 Rating:
Released: 03-27-2008 Last Update: 05-18-2008 Installs: 189
Uses Plugins
Re-useable Code Translations  
No support by the author.

This is a simple add-on which will force users to a specific style based on the url the user visited.

I wrote this with the idea of being able to create a subdomain of mobile.domainname.com and have visitirs to that URL forced to a mobile style whilst visitors to my normal site (domainname.com or www.domainname.com) would be rpesented with my regular style.

Alternatively if you have 2 domain names which point to the same forum, you can have a customized style based on the domain name visited. You can do what you want, but it may be as simple as only having a different banner reflecting the host name visited, or if you have merged 2 forums - users could still get the same skin they always have had if they continue to visit the same URL.

With the HOST matching be aware that if the URL specified in the add-on matches anywhere in the url visited, the add-on will be triggered.

e.g. if URL specified in add-on = domainname.com, any subdomains of domainname.com will match this.

Version Information
1.0.0 - Initial release ported from 3.6 version
1.0.1 - Fixed missing Setting Group Name


product-ddds37.xml supports a single additional domain
product-ddds37_5-domain-version.xml supports one to five additional domains


To upgrade, simply import and allow overwrite.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
CrashPush, Relientk

Comments
  #92  
Old 12-17-2008, 01:49 AM
ls7 ls7 is offline
 
Join Date: Dec 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dartho View Post
Check your .htaccess file to make sure you don;t have any redirects in there - I noticed that ontractdriver.com redirects to www.ontrackdriver.com
Here is my .htaccess file. Would you mind having a look and letting me know if there are redirects in there? (sorry, I am not sure how to decipher)

# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.ontrackdriver\.com
RewriteRule (.*) http://www.ontrackdriver.com/$1 [L,R=301]

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*\.php(/.*)?)$ vbseo.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [L,QSA]
Reply With Quote
  #93  
Old 12-17-2008, 03:38 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm no expert in this area, but I'm guessing that:
Code:
RewriteCond %{HTTP_HOST} !^www\.ontrackdriver\.com
RewriteRule (.*) http://www.ontrackdriver.com/$1 [L,R=301]
is the issue. If it is what it looks like, it is redirecting all URL's which are NOT www.ontrackdriver.com to www.ontrackdriver.com

This would indeed redirect m.ontrackdriver.com to www.ontrackdriver.com

VBSEO would do this as it is good SEO to only have content listed on a single domain name, in this case it's www.ontrackdriver.com. I'd suggest changing this to:

Code:
RewriteCond %{HTTP_HOST} !^ontrackdriver\.com
RewriteRule (.*) http://www.ontrackdriver.com/$1 [L,R=301]
This will then redirect URL's which don't have the www, but leave all others alone. The only other there will be is m.ontrackdriver.com and we don;t want this redirected anyway.

As I said, I'm no expert in this, so rather than delete the lines, copy then and then comment out the originals with a leading '#' character to make reversal easy if need be. You could even do a quick initial test by just commenting out that section altogther before editing.

hope this helps
Reply With Quote
  #94  
Old 12-17-2008, 03:50 PM
ls7 ls7 is offline
 
Join Date: Dec 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, dartho. Commenting out the code worked. But changing it to the code you suggested doesn't work (returns 500 level server error).

At least it appears to be working right now, will continue to test. Is having the code commented out a viable long term solution? Or will that leave vbseo or anything else affected?
Reply With Quote
  #95  
Old 12-17-2008, 08:29 PM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah - I got that previous code quite wrong - try removing the '!' or try the following

Code:
RewriteCond %{HTTP_HOST} ^ontrackdriver.com$ 
RewriteRule ^/(.*) http://www.ontrackdriver.com/$1 [R=301,L]
by not havng the code there, SEO 'experts' suggest you are possibly diluting your Google ranking by having 2 domains publishing the same content (the two domains being www.yourdomain.com and yourdomain.com). My uneducated view is that in the case of a www prefix, google et al wouldn't be that dumb - but it's easy to do (when you know how) so it can;t really hurt.
Reply With Quote
  #96  
Old 12-18-2008, 12:41 PM
ls7 ls7 is offline
 
Join Date: Dec 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dartho View Post
Yeah - I got that previous code quite wrong - try removing the '!' or try the following

Code:
RewriteCond %{HTTP_HOST} ^ontrackdriver.com$ 
RewriteRule ^/(.*) http://www.ontrackdriver.com/$1 [R=301,L]
by not havng the code there, SEO 'experts' suggest you are possibly diluting your Google ranking by having 2 domains publishing the same content (the two domains being www.yourdomain.com and yourdomain.com). My uneducated view is that in the case of a www prefix, google et al wouldn't be that dumb - but it's easy to do (when you know how) so it can;t really hurt.
Hmmm. That code doesn't work, either. Possibly another typo somewhere?
Reply With Quote
  #97  
Old 12-20-2008, 04:15 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As mentioned - I'm no expert in this rewrites .... how about:
Code:
RewriteCond %{HTTP_HOST} !^www\.ontrackdriver\.com [AND]
RewriteCond %{HTTP_HOST} !^m\.ontrackdriver\.com 
RewriteRule (.*) http://www.ontrackdriver.com/$1 [L,R=301]
?
Reply With Quote
  #98  
Old 12-30-2008, 02:58 PM
trainer trainer is offline
 
Join Date: Nov 2001
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

currently have this setup

http://www.site1.com/forums/

shares the forums with

http://www.site2.com/forums/

issue is i am not logged in when i goto the new site forums. everything else seems to be working fine

thanks
Reply With Quote
  #99  
Old 01-05-2009, 03:55 AM
giorgiotave giorgiotave is offline
 
Join Date: Nov 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

I have some error:
Quote:
Warning: preg_match() [function.preg-match]: Unknown modifier 'f' in [path]/global.php(243) : eval()'d code on line 158
This product can be used with php4?
Reply With Quote
  #100  
Old 01-20-2009, 04:45 PM
shahryar_neo shahryar_neo is offline
 
Join Date: Sep 2006
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by giorgiotave View Post
Hi

I have some error:


This product can be used with php4?
i've a same problem !
Reply With Quote
  #101  
Old 01-20-2009, 07:04 PM
yaku yaku is offline
 
Join Date: Oct 2008
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by giorgiotave View Post
Hi

I have some error:

This product can be used with php4?
I had the same problem and saw this in the previous version:

Quote:
All fixed. The errors you were getting were caused by including "http://" with the domain name.

There is also no need to include "www"

For example, "myforum.com" will match "myforum.com" "www.myforum.com" and "wap.myforum.org" - the leading http:// is just a protocol declaration and not a part pf the domain name.
Go to 1) vBulletin Options
2) Different domain, different style
3) Domain Style?

Take out the www and the "http"

That fixed the problem for me.


Love this add-on...great stuff!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:28 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04738 seconds
  • Memory Usage 2,323KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete