301 Redirect for Wordpress

Discussion in 'WordPress' started by nameonthecake, Jul 28, 2007.

  1. #1
    Hi,

    On my word press blog how to I force the www. when people type my domain without the www.

    Thanks
     
    nameonthecake, Jul 28, 2007 IP
  2. bsdpowa

    bsdpowa Banned

    Messages:
    388
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do it two ways.

    1. One way is by editing your .htaccess file on your server by inserting the following lines:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(.*).mysite.com$ [NC]
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
    Code (markup):
    2. The other way is by using a wordpress plugin if you don't have access to your server configuration files. There's a plugin named Redirection that does everything for you. http://urbangiraffe.com/plugins/redirection/
     
    bsdpowa, Jul 29, 2007 IP
  3. nameonthecake

    nameonthecake Banned

    Messages:
    336
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3

    None of these are working...
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(.*).mysite.com$ [NC]
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
    Code (markup):
    This is bringing up internal server error. I think there more to it for a wordpress site...
     
    nameonthecake, Jul 29, 2007 IP
  4. mafrussian

    mafrussian Peon

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    just use the plugin

    and thanks for posting it btw, exactly what i needed!
     
    mafrussian, Jul 29, 2007 IP
  5. FOX LORE

    FOX LORE Notable Member

    Messages:
    8,118
    Likes Received:
    408
    Best Answers:
    0
    Trophy Points:
    230
    #5
    Have you tried changing via Permalinks in Wordpress?

    You need an .htaccess like:


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

    # END WordPress




    Then Options in dashboard go to, Permalink and custom .. I use

    Code:

    /%year%/%monthnum%/%day%/%category%/%postname%.html
     
    FOX LORE, Jul 29, 2007 IP
  6. nameonthecake

    nameonthecake Banned

    Messages:
    336
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I cannot get this to work. I've install plugin after plugin and nothing...what am doing wrong??
     
    nameonthecake, Aug 1, 2007 IP