vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Redirect All Non WWW To WWW? (https://vborg.vbsupport.ru/showthread.php?t=184869)

ALil'Hope 07-10-2008 12:01 AM

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/.

pedroenf 07-10-2008 12:12 AM

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.

ALil'Hope 07-10-2008 12:20 AM

It still only redirects the homepage. Do I need a second .htaccess in my /forums/ directory?

Jase2 07-10-2008 12:20 AM

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]

ALil'Hope 07-10-2008 12:26 AM

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/.

Jase2 07-10-2008 12:39 AM

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.

ALil'Hope 07-10-2008 12:44 AM

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.

Jase2 07-10-2008 12:48 AM

I've just browsed your forums and all threads have www. in the url. What's the problem?

ALil'Hope 07-10-2008 12:53 AM

Read my previous post ;)


All times are GMT. The time now is 10:35 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.01008 seconds
  • Memory Usage 1,724KB
  • 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
  • (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