How do you make seo friendly links in Wordpress?

Discussion in 'WordPress' started by kiplarson, Mar 23, 2007.

  1. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #21
    i knew there was another reason why i included post_id
     
    just-4-teens, Mar 27, 2007 IP
  2. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #22
    Ok,

    I'll post back my .htaccess file once I get er done. I'm going to have to re read over some of the other stuff you said to do though. Didn't get it all.
     
    kiplarson, Mar 27, 2007 IP
  3. Jim_Westergren

    Jim_Westergren Notable Member

    Messages:
    1,882
    Likes Received:
    247
    Best Answers:
    0
    Trophy Points:
    235
    #23
    Well, do what you want but /%postname%/ is the best.

    Even Google engineer Matt Cutts use that:
    http://www.mattcutts.com/blog/

    And me for the last years with not problems. But do what you want, I won't stop you.
     
    Jim_Westergren, Mar 28, 2007 IP
  4. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #24
    When I put in /%postname%/ does that automatically alter my .htaccess file?

    I worry that if I add in the other changes you mentioned I'll accidently overwrite them, or should I just copy the stuff you had (replacing the stuff with my url of course) and just paste it at the top of the .htaccess file?
     
    kiplarson, Mar 30, 2007 IP
  5. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #25
    Ok, I finally got around to doing the .htaccess file:

    Options +Indexes
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^chrisguthrie\.net
    RewriteRule ^(.*)$ http://www.chrisguthrie.net/$1 [R=permanent,L]
    	
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://www.chrisguthrie.net/$1/ [L,R=301]
    
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    PHP:
    The only problem is now the link to my first post looks like this:

    http://www.chrisguthrie.net/http:/www.chrisguthrie.net/hello-world/

    I assume that perhaps it's because I have the rewrite engine on twice in the .htaccess file, as well as few other things that are repeated. What should I take out?

    (note my blog is not at all modified yet, I'm just trying to get this backend stuff working first)

    Also,

    On my other sites I had previously just used this (vBulletin forums):

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    PHP:
    Is it bad to not use the way you did it by typing in the specific url?
     
    kiplarson, Mar 31, 2007 IP
  6. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #26
    Would it be fixed if I just got rid of the second "Rewrite Engine On"?

    I just want to make sure everything's going to be preforming the way it's supposed to both for URL cannonization and SEO without messing up something (As I'm a pretty huge noob at .htaccess editing)
     
    kiplarson, Apr 1, 2007 IP
  7. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #27
    Jim, come to my rescue lol:

    Options +Indexes
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^chrisguthrie\.net
    RewriteRule ^(.*)$ http://www.chrisguthrie.net/$1 [R=permanent,L]
    	
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://www.chrisguthrie.net/$1/ [L,R=301]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    PHP:
    I tried removing the second RewriteEngine on in the #BEGIN WordPress but it didn't change anything. Any ideas on how to fix it?

    Because with that curent .htaccess file I'm still getting links like this:

    http://www.chrisguthrie.net/http:/www.chrisguthrie.net/hello-world/
     
    kiplarson, Apr 2, 2007 IP
  8. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #28
    Has anyone else had this problem before? Please help, I'm a noob when it comes to .htaccess editing.
     
    kiplarson, Apr 5, 2007 IP
  9. Ugg

    Ugg Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #29
    This worked out well for me:

    
    <title>
    <?php wp_title(" "); ?>
    <?php if(wp_title(" ", false)) { echo " | "; } ?>
    Name of my site | Description of site
    </title>
    
    Code (markup):

    now my search results are MUCH more relevant because you get much more of the actual post title.
     
    Ugg, Apr 5, 2007 IP
  10. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #30
    Edit:

    I figured it out. I'm a total noob.

    For permalinks I had my entire url and then /%postname%/

    So I changed it to /%postname%/ and it's all good now.
     
    kiplarson, Apr 5, 2007 IP