Title: Make a site Class B
Last modified: August 18, 2016

---

# Make a site Class B

 *  Resolved [Will Taft](https://wordpress.org/support/users/wt/)
 * (@wt)
 * [19 years ago](https://wordpress.org/support/topic/make-a-site-class-b/)
 * I was looking at the home page of a plugin that does this and saw that “Otto”
   had posted the following:
 * _“While this plugin and other like it will indeed work, I really recommend using
   the .htaccess method instead, if you can get it to work.
    It’s actually very 
   simple to do. Go to no-www org and scroll down the page until you find the post
   titled “Make your site Class B”. Copy that htaccess code into the .htaccess file
   at the root of your webpage. Change the “domain” to your own, obviously. Done
   and done.”  This is the no-wwwcode Otto refers to:
 *  RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC] RewriteRule
   ^(.*)$ [http://domain.com/$1](http://domain.com/$1) [R=301,L]
 * I am cautious about changing the htaccess file as what is in there now was put
   there when I changed my permalinks from the default:
 * # BEGIN WordPress<IfModule mod_rewrite.c>
    RewriteEngine OnRewriteBase / RewriteCond%{
   REQUEST_FILENAME} !-fRewriteCond % {REQUEST_FILENAME} !-dRewriteRule . /index.
   php [L] </IfModule># END WordPress
 * Do I replace the current htaccess code with the no-www code? Or put the np-www
   code at the end of the existing? Or, edit the no-www code into the existing?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Will Taft](https://wordpress.org/support/users/wt/)
 * (@wt)
 * [19 years ago](https://wordpress.org/support/topic/make-a-site-class-b/#post-558250)
 * For anyone who finds this in a search… Below is what I did to get this to work.
   The two lines in the middle are what I added to the existing file. It appears
   to work correctly. If any of the experts here see a problem with the code, please
   respond. Otherwise, I’ll mark it resolved. Thanks.
 *     ```
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
   
       RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ [NC]
       RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]
   
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       # END WordPress
       ```
   
 *  Thread Starter [Will Taft](https://wordpress.org/support/users/wt/)
 * (@wt)
 * [19 years ago](https://wordpress.org/support/topic/make-a-site-class-b/#post-558647)
 * As an update, it appears this code needs to be first and apart from the WordPress
   section of the htaccess file to avoid being rewritten.
 * This is what my htaccess file looks like now:
 * <IfModule mod_rewrite.c>
    RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST}
   ^www\.yoursite\.com$ [NC] RewriteRule ^(.*)$ [http://yoursite.com/$1](http://yoursite.com/$1)[
   R=301,L] </IfModule>
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond%{
   REQUEST_FILENAME} !-f RewriteCond %
 * {REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L] </IfModule>
 * # END WordPress
 *  [jplancaster](https://wordpress.org/support/users/jplancaster/)
 * (@jplancaster)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/make-a-site-class-b/#post-558698)
 * I don’t get it. Why not default to www as google and most other larger sites?
   I allow both but why do some end up going to [http://www.site.com?](http://www.site.com?)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Make a site Class B’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [jplancaster](https://wordpress.org/support/users/jplancaster/)
 * Last activity: [18 years, 9 months ago](https://wordpress.org/support/topic/make-a-site-class-b/#post-558698)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
