vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How can I prevent the WWW version of my website from being displayed? (https://vborg.vbsupport.ru/showthread.php?t=270059)

tmanran123 09-11-2011 05:51 AM

How can I prevent the WWW version of my website from being displayed?
 
Thanks for reading!

I'd simply like to prevent the www version of my vbulletin install from being accessible.

e.g. when a person goes to the www version of my forum URL, i'd like to have the www disappear and go to the non www version.

I guess I'd use the htaccess file??? Or do i use canonical tags?

Please help :confused:

Thanks

HMBeaty 09-11-2011 11:07 PM

Add this to your .htaccess in your sites root directory. If you don't have one there, create one and add this to it:
Code:

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


Eric 09-12-2011 01:22 AM

Also, be sure to update the URL in your admincp before making the change, or you may not be able to login (depending on cookie settings)

HMBeaty 09-12-2011 01:31 AM

Quote:

Originally Posted by Eric (Post 2244730)
Also, be sure to update the URL in your admincp before making the change, or you may not be able to login (depending on cookie settings)

Yes, very true! Thank you :)

tmanran123 09-12-2011 02:01 AM

Thanks guys

can you be more specific about:

"be sure to update the URL in your admincp"

what does this mean?

HMBeaty 09-12-2011 02:14 AM

Quote:

Originally Posted by tmanran123 (Post 2244741)
Thanks guys

can you be more specific about:

"be sure to update the URL in your admincp"

what does this mean?

Sure. When you navigate to:
Code:

AdminCP => Settings => Options => Site Name / URL / Contact Details => Forum URL
AdminCP => Settings => Options => Site Name / URL / Contact Details => Homepage URL

Make sure both of those settings do not contain the www.

For example, if you currently have http://www.yoursite.com, you need to change that to http://yoursite.com :)

tmanran123 09-12-2011 03:47 AM

Yay it works

Thanks!!!!!!!!!!!!!!!

http://happy-pictures.net/wp-content...appy-Cat11.jpg

HMBeaty 09-12-2011 03:55 AM

No problem :)

Max Taxable 09-12-2011 11:46 AM

Just curious, but how is this different from the following?

Code:

RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://yourdomain.com/$1 [R=301,L]



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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01228 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete