vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to redirect site.com to www.site.com? (https://vborg.vbsupport.ru/showthread.php?t=255066)

Bouncer222 12-12-2010 04:16 PM

Quote:

Originally Posted by Weetabix (Post 2132804)
put this immediately after 'RewriteEngine On'

Code:

Options +FollowSymLinks

### Add www.

rewritecond %{http_host} ^fragtoss.com [nc]
rewriterule ^(.*)$ http://www.fragtoss.com/$1 [r=301,nc]


Doesn't work.

Maybe there's something else in the .htaccess which I posted before that's conflicting?

Or how about this..

Anyone have their method ACTUALLY WORK on their own forums? I mean kinda pointless posting this stuff here if it doesn't work. I would appreciate it if someone tested it on their own forums first.

Thanks.

Weetabix 12-12-2010 04:29 PM

Strange, that code USED to work fine for me........

edit> http://bfb-online.com wont work, but if you type bfb-online.com into your address bar it works.

Digital Jedi 12-12-2010 06:23 PM

Quote:

Originally Posted by Bouncer222 (Post 2132909)
Doesn't work.

Maybe there's something else in the .htaccess which I posted before that's conflicting?

Or how about this..

Anyone have their method ACTUALLY WORK on their own forums? I mean kinda pointless posting this stuff here if it doesn't work. I would appreciate it if someone tested it on their own forums first.

Thanks.

This is how it looks on mine.

Code:

RewriteEngine on
rewritecond %{http_host} ^cogonline.net [nc]
rewriterule ^(.*)$ http://www.cogonline.net/$1 [r=301,nc]

Seems to be identical to yours, and it's been working for years. In fact, this is what cPanel wrote in. So something more must be going on here.

http://www.cogonline.net | http://cogonline.net

Weetabix 12-12-2010 06:26 PM

DNS not resolving the 2 part domain, rather than something wrong with the code?

Digital Jedi 12-12-2010 06:29 PM

The SEO wouldn't be messing with it, would it?

Weetabix 12-12-2010 06:37 PM

Just noticed;

Code:

# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

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

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

The code seems to be there already, just remove the # and put your domain in there. TBH though, you're probably better off asking at the vBSEO forums just in case their rules are somehow affecting this as Jedi suggests. There seems to be plenty of threads about it.

edit> this thread looks promising LINKY

Bouncer222 12-12-2010 07:08 PM

yeah i noticed later before u posted that, that the yourdomain.com needed to be changed, although I forgot to remove the number sign to uncomment it.

I also removed forums/ since my forums are in the root. It's all fixed now thank you all.

Digital Jedi 12-13-2010 12:24 AM

That's where I got the first suggestion I posted, but didn't realize it needed to be the actual two lines with the hashtags removed and not just duplicated. Good to know.

FReeSTER 12-13-2010 02:44 PM

Well I have the same issue and have posted here but nothing happen to get it to work correctly. It give me error 404
I currently using the http:// right now but never been able to fix it to work on www instead

Any ideas?

Digital Jedi 12-13-2010 10:10 PM

The http:// should always be there, www or not. What this is, is directing one without to one with. Is that what you were going for?


All times are GMT. The time now is 04:55 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.01088 seconds
  • Memory Usage 1,740KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete