http:// vs www.?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OS,
    Senior Member
    • Aug 2005
    • 465
    • 3.6.x

    http:// vs www.?

    Hi each time i enter my domain www.mydomain.com it remains to be www.mydomain.com as well as other sub domains sections. But if i try to enter my forum www.mydomain.com/forum then it changes to http://mydomain.com/forum missing out the www. what could possibly be wrong here?

    Cheers thanks!
  • Floris
    Senior Member
    • Dec 2001
    • 37767

    #2
    Perhaps your host or your own .htaccess is set to mod_rewrite www. to just the domain, but doesn't work on the forum/ dir? Or your forum path is set to that url so all the forum urls have www in them?

    Here's an example of a .htaccess file that forces index.php to go to just the / at the end, and it forces www. to the url if it isn't. (set your forum Admin Control Panel > vBulletin Options > vBulletin Options > Site URL etc options to have www. in it.)

    the .htaccess goes into your public_html/ dir (MAKE BACKUP if you already use a .htaccess file! - or rather merge it)

    Code:
    ###########################################################
    # MOD_REWRITE
    ###########################################################
    Options +FollowSymlinks
    RewriteEngine On
    
    ###########################################################
    # To / instead of index.php
    ###########################################################
    RewriteCond %{THE_REQUEST} index\.php
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^index\.php$ / [L,R=301]
    
    #########################
    # ADD WWW.
    #########################
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

    Comment

    Related Topics

    Collapse

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎