Restrict URL in htaccess. Help?

Discussion in 'HTML & Website Design' started by seo5000, Dec 4, 2009.

  1. #1
    I am trying to 301 redirect the http://whatever site to www.whatever site. to eliminate duplicate content to the SERPS.

    The actual site is, nwime doot cm / classifieds

    Can someone suggest a code for the htaccess in the classifieds subfolder to do this?

    I can't figure it out!!

    Thanks in advance! :)
     
    seo5000, Dec 4, 2009 IP
  2. AssistantX

    AssistantX Peon

    Messages:
    173
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In your .htaccess file add:
    
    [CODE]
    RewriteEngine on
    rewritecond %{http_host} ^whatever.com [nc]
    rewriterule ^(.*)$ http://www.whatever.com/$1 [r=301,nc]
    [/CODE]
    PHP:
     
    AssistantX, Dec 4, 2009 IP
  3. seo5000

    seo5000 Peon

    Messages:
    2,026
    Likes Received:
    231
    Best Answers:
    0
    Trophy Points:
    0
    #3
     
    seo5000, Dec 5, 2009 IP
  4. AssistantX

    AssistantX Peon

    Messages:
    173
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    A subdirectory's .htaccess can not affect the settings of its parent directory. You would have to change the .htaccess of the parent directory.
     
    AssistantX, Dec 5, 2009 IP
  5. blufer

    blufer Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks for useful info
     
    blufer, Dec 7, 2009 IP