1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

mod_rewrite: xxx.com redirect to www.xxx.com

Discussion in 'Apache' started by nicolas9510, Jan 22, 2007.

  1. #1
    as the tile says i want to redirect xxx.com to www.xxx.com on my domain
    i searched google and tried(in .htaccess):
    Options +FollowSymlinks
    Rewriteengine On
    rewritecond %{http_host} ^proxyforfun.com [nc]
    rewriterule ^(.*)$ http://www.proxyforfun.com/$1 [r=301,nc]

    this doesnt seem to work, i put it at the root of my website. i check the apache config file and made sure that mod_rewrite was loaded(and it is)

    any ideas why this doesn work? or another way to do this?
    thanks
     
    nicolas9510, Jan 22, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^proxyforfun\.com [NC]
    RewriteRule ^(.*)$ http://www.proxyforfun.com/$1 [R=301,L]
     
    Nintendo, Jan 23, 2007 IP
  3. nicolas9510

    nicolas9510 Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    still doent work :/
    i tried chowning it to different users also, just in case. doesnt work
    i ahve no idea why this wouldnt work :/
    when i do a phpinfo() it does indeed show that mod_rewrite is loaded
    any ideas?
     
    nicolas9510, Jan 23, 2007 IP
  4. smatts9

    smatts9 Active Member

    Messages:
    1,089
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    88
    #4
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^proxyforfun\.com
    RewriteRule (.*) http://www.proxyforfun.com/$1 [R=301,L]
    </IfModule>
    
    Code (markup):
    i don't see why this wouldn't work, it's baically what Nintendo wrote for you. Give it a try.
     
    smatts9, Jan 23, 2007 IP
  5. nicolas9510

    nicolas9510 Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i tried putting that in the .htaccess file, still doesnt work, when i type without the www it still loads without redirecting to www domain
    i have no earthly clue why this would happen
     
    nicolas9510, Jan 23, 2007 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    E-Mail your web host! And try this test

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^wacko\.html$ index.XXX [L]

    If domain.com/wacko.html doesn't show the same thing as index.XXX (whatever extension is) then you don't have it!!
     
    Nintendo, Jan 23, 2007 IP
  7. nicolas9510

    nicolas9510 Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    all is now good, had to set the option: AllowOverride All in httpd.conf
    so now it works
    thanks a bunch
     
    nicolas9510, Jan 23, 2007 IP