vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Redirecting non-www to www on forum links (https://vborg.vbsupport.ru/showthread.php?t=224457)

Quantnet 10-03-2009 12:15 AM

Redirecting non-www to www on forum links
 
There are numerous examples on the net and I tried to use some of them. Here is the latest I used

Code:

RewriteEngine On

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

This will redirect mysite.com to www.mysite.com but if I enter mysite.com/forum/showthread.php?t=1234 it will not return www.mysite.com/forum/showthread.php?t=1234

vb.org has it working correctly here. I want it always show www in my links.

thanks

HMBeaty 10-03-2009 12:18 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=222898" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=222898</a>

Medtech 10-03-2009 12:18 AM

there is a modification here that will do what you are looking for.

HMBeaty 10-03-2009 12:19 AM

Quote:

Originally Posted by Medtech (Post 1894027)
there is a modification here that will do what you are looking for.

You mean the one I just posted a link to? LOL ;)

Medtech 10-03-2009 12:20 AM

yeah, we both posted at the same time..lol

HMBeaty 10-03-2009 12:21 AM

I know, I was just giving you a hard time :D

Quantnet 10-03-2009 12:39 AM

Thanks for the quick replies, you guys ;)
I knew about that mod but i'm curious why we can't do this in .htaccess since it's more flexible, powerful.

I'm looking for some .htaccess code that will accomplish what the mod does, basically.

HMBeaty 10-03-2009 12:57 AM

Not sure if this will work, but its what I used to use and its SLIGHTLY different the code you used, but try...
Code:

RewriteEngine On
rewritecond %{http_host} ^yourdomain.com
rewriteRule ^(.*) http://www.yourdomain.com/$1 [R=301,L]


Quantnet 10-03-2009 01:35 AM

I tried that version too and it works for the main page but as soon as i have some subdirectory in the link as in the example in my first post, it does not work.


All times are GMT. The time now is 05:00 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.01141 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)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