Help Needed For htaccess Formatting Thingy...Help...Please :(

Discussion in 'Site & Server Administration' started by Whatarewewaitingfor?, Jan 15, 2009.

  1. #1
    Okay, I'm really not as pathetic as the title makes it seem, but it got your attention!

    I need help getting this to work! Any help with greatly appreciated!

    How can I sucessfully implement the removal of the www. from my domain and also clean up the URL at the same time? Here are the two statements I'm using:

    #Remove WWW from domain
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301]

    #clean up URL
    RewriteCond %{SCRIPT_FILENAME} ^(.*)/(.*)$
    RewriteRule ^(.*)/(.*)$ /index.php?$1&x=$2


    Anyone?
     
    Whatarewewaitingfor?, Jan 15, 2009 IP
  2. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #2
    #Remove WWW from domain
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
     
    Camay123, Jan 15, 2009 IP
  3. Whatarewewaitingfor?

    Whatarewewaitingfor? Active Member

    Messages:
    253
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #3
    I don't really see how those two codes are any different (?) maybe I am missing something here?
     
    Whatarewewaitingfor?, Jan 16, 2009 IP