PDA

View Full Version : Forwarding http:// to http://www.


TruthElixirX
04-24-2009, 09:35 PM
Is there a way to do this on vBulletin without using mod_rewrite and a .htaccess file? My site is running into problems with cookies (If you visit without the www. then you aren't logged in, the web browser sees it as two cookies, or something.)?

Is there a fix for making one cookie work on http:// and http://www.?

Kiros72
04-25-2009, 08:28 AM
I'm fairly certain that you're going to have to use a .htaccess rewrite if you want to forward to www.*

But have you tried changing the cookie options in your vBulletin AdminCP? For instance, modifying the cookie domain to be ".domain.com" without quotes and where domain.com is actually your domain (notice the dot in front of the domain name).

bbcentral
04-26-2009, 06:38 AM
I had the exact same issue with my forum.

In your .htaccess file, put this:

################################################## #########
# MOD_REWRITE
################################################## #########
Options +FollowSymlinks
RewriteEngine On

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


Demo:
http://bluesbrotherscentral.com
http://bluesbrotherscentral.com/forum/
(both forward to 'www')

It's a 301 redirect (Moved Permanently), so it should also help you as far as Search Engine indexing/optimisation.

sheppardzwc
04-26-2009, 01:14 PM
I had the exact same issue with my forum.

In your .htaccess file, put this:

################################################## #########
# MOD_REWRITE
################################################## #########
Options +FollowSymlinks
RewriteEngine On

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


Demo:
http://bluesbrotherscentral.com
http://bluesbrotherscentral.com/forum/
(both forward to 'www')

It's a 301 redirect (Moved Permanently), so it should also help you as far as Search Engine indexing/optimisation.
...and make sure that the rewrite module is on in your Apache.

bbcentral
04-26-2009, 05:28 PM
...and make sure that the rewrite module is on in your Apache.
Well that's usually a given, but yes :)

NeoSov
04-26-2009, 10:31 PM
Thank you!

nomoreturn
04-30-2009, 05:09 AM
Thanks its works on my site