Rewrite htaccess WWW is not working

Discussion in 'Apache' started by thanapa, Jan 1, 2009.

  1. #1
    Hi

    i have some problems in .htaccess file. From http://abc-guide.co.uk to www.abc-guide.co.uk


    i'm using below code for url rewriteing. Now site is working without www. How can i change that into from http:// to http://www . This is for co.uk domain.


    how can i add www before domain.
     
    thanapa, Jan 1, 2009 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    try this
    Rewiteengine On
    RewriteCond %{HTTP_HOST} !^www\.abc-guide\.co\.uk [NC]
    RewriteRule (.*) http://www.abc-guide.co.uk/$1 [R=301,L]
    RewriteRule (.*)-(.*).html siteview.php?title=$1&pid=$2

    I hope it shd work
    Regards

    Alex
     
    kmap, Jan 1, 2009 IP
  3. LinkBliss

    LinkBliss Peon

    Messages:
    697
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    LinkBliss, Jan 1, 2009 IP