Some basic question on HTACCESS

Discussion in 'Site & Server Administration' started by Nystul, May 14, 2008.

  1. #1
    Just wondering ..

    I have already made a new .htaccess to permit me to rewrite my permalinks to %post

    So right now i wanted to add more new things into the htaccess so that I can do a 301 redirect of www to non www

    SO, do i add the new code ONTOP of the code i have written for the permalinks ?

    --> which means i just copy out the exisiting code from ftp server, and add on the new code and thats it, right ?

    Please let me know : )) Thanks in advance
     
    Nystul, May 14, 2008 IP
  2. calum

    calum Peon

    Messages:
    2,821
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just adding it to the top should work fine.
     
    calum, May 15, 2008 IP
  3. Trusted Writer

    Trusted Writer Banned

    Messages:
    1,370
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Sure, as simple as editing your .htaccess file with your html editor or notepad, making sure to add at the top this code

    
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^www.domain.com [nc]
    rewriterule ^(.*)$ http://domain.com/$1 [r=301,nc] 
    
    
    Code (markup):
    then save, reupload and overwrite the original file :)
     
    Trusted Writer, May 17, 2008 IP
  4. Nystul

    Nystul Well-Known Member

    Messages:
    3,077
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    175
    #4
    Thanks to you 2 for the help : )) Appreciate it. Going to try it on a bogey site 1st
     
    Nystul, May 18, 2008 IP