Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
MULTIPLE cookieless domains (speed improvement)
LuisManson
Join Date: Jun 2010
Posts: 115

by LuisManson LuisManson is offline 10 Jul 2010

Since vbulletin uses a LOT of images plus CSS and JS i decided to separate all of them into cookie less domains

First of all on admincp set cookies only for your forum MAIN domain (ie www.mysite.com) not .mysite.com

DNS:
First of all i created some subdomains
static.mysite.com
static2.mysite.com
staticcss.mysite.com
staticjs.mysite.com

all of them pointing to the same server

Web server:
i created a new vhost:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Filesystem:
My vb site is in: /usr/local/www/web_mysite_com
and the static content is in: /usr/local/www/estaticos_mysite_com
inside this new vhost directory i also made two aliases (because of my permissions)

clientscript -> ../web_mysite_com/clientscript
images -> ../web_mysite_com/images

* given my permission direct access to this shite would give you a forbidden, maybe you could create an empty index file

htaccess:
i have a redirect for my domain so now i had to make a few changes to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

plugin:
go to your admincp and create a new plugin in global_complete hook

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

*original code from here: http://www.vbulletin.org/forum/showp...1&postcount=13

images:
Go yo "templates and styles"
choose your style and then in Style Vars filter by imgdir
replace those PATHs with new-hostname/ + original path
IE: images/buttons -> http://static2.mysite.com/images/buttons


NOTE: because a bug in vb code here you can make a real mess, check this report first:
http://tracker.vbulletin.com/browse/VBIV-7479
* Long story short:
a solution that worked for me was from David Grove:
The "fixes" described in the above comments are incorrect. To patch this issue, until v4.0.5 comes out, please edit line 489 of /admincp/stylevar.php, and change TYPE_ARRAY_ARRAY to TYPE_ARRAY.

So lines 485 through 491 should be changed from this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is of course, not the complete fix, but it will allow editing stylevars to work until v4.0.5 is released.
and you are done, now your site should be a bit faster
Views: 6343
Reply With Quote
Comments
  #2  
Old 15 Jul 2010, 13:12
lazydesis lazydesis is offline
 
Join Date: Sep 2006
Thanks .. very nice article

does this work for vb3.8? or is it only for vb4?
__________________
http://www.lazydesis.com
Reply With Quote
  #3  
Old 16 Jul 2010, 01:18
klaus's Avatar
klaus klaus is offline
 
Join Date: Mar 2002
Real name: Klaus
If your htaccess goal is to simply force a www you can simplify it to:

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

It will now allow anyhost.mysite.com but when its just mysite.com without a subdomain or host it 301's to tripleW.

2lines vs. 6 lines
Reply With Quote
  #4  
Old 16 Jul 2010, 17:45
Sayid Sayid is offline
 
Join Date: Jan 2009
Useful article and it will improve page rank when I use firebug add-on in FF
Thanks and subscribed to this.
Reply With Quote
  #5  
Old 17 Jul 2010, 05:55
tech4c tech4c is offline
 
Join Date: Jan 2009
Real name: Homoud
Demo if you can !

Regards,
Reply With Quote
  #6  
Old 21 Jul 2010, 11:39
LuisManson LuisManson is offline
 
Join Date: Jun 2010
thanks all,
Sayid, how could this improve pagerank?
klaus: you are right, im not sure why i did it this way
lazyindian: it should work
Reply With Quote
  #7  
Old 23 Jul 2010, 01:47
Shabcool Shabcool is offline
 
Join Date: Jul 2008
thanks
Reply With Quote
  #8  
Old 25 Sep 2010, 06:36
as7apcool's Avatar
as7apcool as7apcool is offline
 
Join Date: Feb 2009
thanks 4 useful topic
Reply With Quote
  #9  
Old 15 Jun 2011, 17:43
sivaganeshk sivaganeshk is offline
 
Join Date: Oct 2010
should I paste this code ? where ? or is this commands?
Reply With Quote
  #10  
Old 18 Jun 2011, 18:41
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
 
Join Date: Sep 2008
Real name: Michael Miller Jr
Question

Originally Posted by sivaganeshk View Post
should I paste this code ? where ? or is this commands?
Which code are you referring to? Basically the codes listed above need to be added to files, you edit, add the code then save and check to ensure the changes are present and you setup everything properly.
__________________
Daddy Does Dios and Figs!
https://www.linkedin.com/in/thelastsuperman
For all your vBulletin and Wordpress custom needs.

Search - Use the search feature to find similar issues/answers.
Information - Include screenshots, copy/pasted error codes, url etc.
Fixed - Please return to your thread/post and let us know how it was fixed!
Thanks - For participating! Click the "Like" on a post if someone helped you!
Reply With Quote
  #11  
Old 02 Aug 2011, 10:31
Post Reader's Avatar
Post Reader Post Reader is offline
 
Join Date: Nov 2009
Real name: Wajdaan Alam
i am wondering if i can know about the vhost creation
Reply With Quote
Reply

Similar Article
Article Author Type Replies Last Post
[Improvement] vBStats -> Top Posters list PHP-code improvement (much less queries) KuraFire vBulletin 2.x Full Releases 10 15 Feb 2003 13:53
[Improvement] vBStats -> Member Referrer list PHP-code improvement (much less queries KuraFire vBulletin 2.x Full Releases 23 15 Feb 2003 09:31



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 06:23.

Layout Options | Width: Wide Color: