site.com/folder/ to www.site.com/folder/

Discussion in 'Site & Server Administration' started by kusadasi-guy, May 11, 2005.

  1. #1
    i can redirect my subpages but can not redirect pages in folders ( http : //site.com/page.html to http : //www . site.com/page.html ) with using this lines;
    RewriteCond %{HTTP_HOST} ^site\.com [NC]
    RewriteRule ^(.*) http://www. site.com/$1 [R=301,L] 
    PHP:
    but, in one of my directory, i cant do that. Can you help me to redirect my pages to WWW address
    ( site.com/folder/page.html to www . site.com/folder/page.html) ?
     
    kusadasi-guy, May 11, 2005 IP
  2. norfstar

    norfstar Peon

    Messages:
    1,154
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try:

    RewriteCond %{HTTP_HOST} ^site\.com$
    RewriteRule ^(.*)$ http://www.site.com/$1 [R] 
    Code (markup):
     
    norfstar, May 11, 2005 IP
  3. kusadasi-guy

    kusadasi-guy Peon

    Messages:
    83
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteCond %{HTTP_HOST} ^site\.com$
    RewriteRule ^(.*)$ http://www.site.com/dir/$1 [R=301,L]
    PHP:
    there was another htaccess file in my /dir/ folder, i think that caused the problem. i added the lines above and fixed the problem, thanks.
     
    kusadasi-guy, May 11, 2005 IP