i dont want http://www.mydomain.com, but http://mydomain.com, how?

Discussion in 'Programming' started by nevret2, May 4, 2008.

  1. #1
    hello,

    when people visiting my site they gey only urls like

    http://www.mydomain.com etc etc

    but i i want no www, they must see urls like http://mydomain.com

    my .hacces file:
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Code (markup):

    hope someone will help
     
    nevret2, May 4, 2008 IP
  2. Trusted Writer

    Trusted Writer Banned

    Messages:
    1,370
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #2
    This has been explained over and over throughout this forum so you wouldn't have to wait for my answer if you would try searching first.

    Anyway this is the rule to be added into your .htaccess files
    
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{http_host} ^www\.yourdomain\.com [NC]
    RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,NC]
    
    Code (markup):
     
    Trusted Writer, May 4, 2008 IP
  3. nevret2

    nevret2 Peon

    Messages:
    518
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    but how to put that in my code of .hacces here above? how will the code looks like

    i did as next but its not working:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteCond %{http_host} ^www\.mysiteurl\.com [NC]
    RewriteRule ^(.*)$ http://mysiteurl.com/$1 [R=301,NC]
    </IfModule>

    # END WordPress
     
    nevret2, May 4, 2008 IP
  4. solutionsystem

    solutionsystem Member

    Messages:
    73
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #4
    check your hosting-account control-panel also - there is provision for 'www' with domain or not - also provided!
     
    solutionsystem, May 5, 2008 IP
  5. nevret2

    nevret2 Peon

    Messages:
    518
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thnx kardas but i cant find it in my cpanel
     
    nevret2, May 5, 2008 IP
  6. Trusted Writer

    Trusted Writer Banned

    Messages:
    1,370
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #6
    If you cannot find your control panel, are then you reading this file through your FTP?

    Either you are working with FTP or Filemanager, make sure to overwrite the above setting this way:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteCond %{http_host} ^www\.mysiteurl\.com [NC]
    RewriteRule ^(.*)$ http://mysiteurl.com/$1 [R=301,NC]
    </IfModule>
    
    # END WordPress
    
    
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{http_host} ^www\.yourdomain\.com [NC]
    RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,NC]
    
    
    Code (markup):
    Once done, save the file and it must do the trick ;)
     
    Trusted Writer, May 5, 2008 IP
  7. nevret2

    nevret2 Peon

    Messages:
    518
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thnx 'Trusted Writer' i solved it already yesterday
     
    nevret2, May 6, 2008 IP
  8. Trusted Writer

    Trusted Writer Banned

    Messages:
    1,370
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #8
    No problem, glad to hear your site is running smoothly now ;)
     
    Trusted Writer, May 6, 2008 IP