301 Redirect

Discussion in 'Site & Server Administration' started by sixty6, Jan 15, 2006.

  1. #1
    sixty6, Jan 15, 2006 IP
  2. jrd1mra

    jrd1mra Peon

    Messages:
    243
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    first of all, what type of programming do you use? PHP ASP ASP.NET etc... PHP and ASP are the only type of file extension you can redirect with a simple code upload. The other two you would have to make a server side modification (probobaly) unless you have access to the httpd.ini file.

    Since your avatar is buggering a penguin, I am guessing that you are not on a linux server :)
     
    jrd1mra, Jan 15, 2006 IP
  3. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #3
    I am on a linux server and the pages are mostly in PHP, what would I need to do?
     
    sixty6, Jan 15, 2006 IP
  4. jrd1mra

    jrd1mra Peon

    Messages:
    243
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    add this to your htaccess (assuming your webhost allows you to modify it)
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.domain\.com
    RewriteRule ^/(.*) http://www.domain.com/$1 [R=301,L]

    if you are on a linux server there may be a way to do it through your control panel also.
     
    jrd1mra, Jan 15, 2006 IP
  5. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #5
    alright thanks!!
     
    sixty6, Jan 15, 2006 IP