Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2008, 12:01 AM
ALil'Hope ALil'Hope is offline
 
Join Date: Jun 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Redirect All Non WWW To WWW?

What exactly do I put in my .htaccess to make it redirect my homepage AND my forums to WWW?

Quote:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.gamerzrevolution\.com [NC]
RewriteRule ^(.*) http://www.gamerzrevolution.com/$1 [L,R=301]
I have that in my public_html, but it doesn't redirect gamerzrevolution.com/forums/.
Reply With Quote
  #2  
Old 07-10-2008, 12:12 AM
pedroenf pedroenf is offline
 
Join Date: Jun 2006
Location: Portugal
Posts: 308
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:
Quote:
RewriteCond %{HTTP_HOST} !^www\.gamerzrevolution\.com
RewriteRule (.*) http://www.gamerzrevolution.com/$1 [L,R=301]
But be sure to have mod_rewritte settings on you apache right.
Reply With Quote
  #3  
Old 07-10-2008, 12:20 AM
ALil'Hope ALil'Hope is offline
 
Join Date: Jun 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It still only redirects the homepage. Do I need a second .htaccess in my /forums/ directory?
Reply With Quote
  #4  
Old 07-10-2008, 12:20 AM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Called a permanent 301 redirect. Here's what you need:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^YourSite\.com [nc]
RewriteRule (.*) http://www.YourSite.com/$1 [R=301,L]
Reply With Quote
  #5  
Old 07-10-2008, 12:26 AM
ALil'Hope ALil'Hope is offline
 
Join Date: Jun 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do I need that .htaccess in my root and my forum? I have it in my root, but it still doesn't redirect gamerzrevolution.com/forums/.
Reply With Quote
  #6  
Old 07-10-2008, 12:39 AM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Am I understanding you correctly here? The above that I posted will redirect all non www. urls on your site to www. If you need something else, then please let me know exactly what you're trying to achieve.
Reply With Quote
  #7  
Old 07-10-2008, 12:44 AM
ALil'Hope ALil'Hope is offline
 
Join Date: Jun 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already placed that in my .htaccess, which is inside my public_html directory. My forums are located in my public_html/forums/ directory. It only redirects gamerzrevolution.com to www.gamerzrevolution.com. It does not work on gamerzrevolution.com/forums/.

Edit: I had a previous .htaccess located inside my forums directory, which was causing it to not work.
Reply With Quote
  #8  
Old 07-10-2008, 12:48 AM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've just browsed your forums and all threads have www. in the url. What's the problem?
Reply With Quote
  #9  
Old 07-10-2008, 12:53 AM
ALil'Hope ALil'Hope is offline
 
Join Date: Jun 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Read my previous post
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 11:04 PM.


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.04051 seconds
  • Memory Usage 2,229KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete