Results 1 to 7 of 7
  1. #1
    New Pligger willy4987's Avatar
    Joined
    Apr 2010
    Posts
    16

    How to redirect from www to wihout www

    Hi, i have little problem with my site
    my site can open with www and without www
    1. PliggDev - Your Source for Social Bookmark
    2. http://www.pliggdev.com

    I want to use my site without the www, how to keep www.pliggdev.com redirected to pliggdev.com? because i only want to use pliggdev.com

    is it correct .htaccess like this?
    ## Remove these two lines if you have a sub-domain like http://subdomain.pligg.com or http://localhost
    ## Keep if your site it like http://pligg.com
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
    ##### Re-directing End #####

  2. #2
    Casual Pligger aahna's Avatar
    Joined
    May 2010
    Posts
    64
    Quote Originally Posted by willy4987 View Post
    Hi, i have little problem with my site
    my site can open with www and without www
    1. PliggDev - Your Source for Social Bookmark
    2. http://www.pliggdev.com

    I want to use my site without the www, how to keep www.pliggdev.com redirected to pliggdev.com? because i only want to use pliggdev.com

    is it correct .htaccess like this?
    Just add this code in your .htaccess file on the top

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^dpliggdev.com$ [NC]
    RewriteRule ^(.*)$ http://pliggdev..com/$1 [L,R=301]

  3. #3
    New Pligger willy4987's Avatar
    Joined
    Apr 2010
    Posts
    16
    Quote Originally Posted by aahna View Post
    Just add this code in your .htaccess file on the top

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^dpliggdev.com$ [NC]
    RewriteRule ^(.*)$ http://pliggdev..com/$1 [L,R=301]
    After try your code it cause "server not found" that means my site cannot open

  4. #4
    Casual Pligger aahna's Avatar
    Joined
    May 2010
    Posts
    64
    Quote Originally Posted by willy4987 View Post
    After try your code it cause "server not found" that means my site cannot open
    Ok try this

    RewriteEngine On
    RewriteCond %{HTTP_HOST} http://www.pliggdev.com
    RewriteRule ^(.*)$ http://pliggdev.com/$1 [R]

  5. #5
    New Pligger willy4987's Avatar
    Joined
    Apr 2010
    Posts
    16
    i've tried my site still work but PliggDev - Your Source for Social Bookmark not redirect to http:/pliggdev.com/

  6. #6
    Senior Member web20guy's Avatar
    Joined
    Jun 2007
    Posts
    198
    Code:
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    or

    Code:
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
    RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
    or....this search

  7. #7
    New Pligger willy4987's Avatar
    Joined
    Apr 2010
    Posts
    16
    Quote Originally Posted by web20guy View Post
    Code:
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    or

    Code:
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
    RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
    or....this search
    thank you so much bro, now it works

Similar Threads

  1. redirect problem
    By kevin4uguys in forum Questions & Comments
    Replies: 0
    Last Post: 11-30-2010, 07:21 PM
  2. 301 Redirect
    By laurentiuvlad in forum Questions & Comments
    Replies: 5
    Last Post: 07-01-2009, 05:22 AM
  3. Trackback 302 redirect
    By zoom in forum Questions & Comments
    Replies: 1
    Last Post: 01-14-2007, 07:33 PM
  4. How do I redirect to the homepage?
    By hakaii in forum Questions & Comments
    Replies: 1
    Last Post: 11-09-2006, 07:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting