.htaccess help (mod_rewrite)

Discussion in 'Apache' started by Mr. Goodie2Shoes, Jul 15, 2011.

  1. #1
    I am using Joomla and vBulletin for my site and have two different ".htaccess"s

    The one in the root directory is working fine (for Joomla!)... but I am having problem in redirecting www to Sans-www for the board... its not redirecting...

    To make it more simple:
    my forum should redirect www.mysite.com/forums to mysite.com/forums

    any tips guys?
     
    Mr. Goodie2Shoes, Jul 15, 2011 IP
  2. helpinghost

    helpinghost Active Member

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #2
    Without seeing the current .htaccess it is a bit hard to judge but basically you would say:

    RewriteCond %{HTTP_HOST} !^example\.com$ (if Hostname does not start with example.com)
    RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] (redirect to example.com/URI )
     
    helpinghost, Jul 28, 2011 IP
  3. christianlouboutin

    christianlouboutin Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this solve my problem
     
    christianlouboutin, Jul 30, 2011 IP