WordPress users – sharpen your URLs with Google!
Update: October 1, 2009
This article is from january 2006. In new versions of WordPress all the things in this article is being taken care of automatically. DO NOT USE IT ANYMORE.
First of all you must enable the permalinks, but that you probably already have done.
Now to the point. Did you know that these are all different URLs for the same blog post?
http://www.myblog.com/my-blog-post
http://www.myblog.com/my-blog-post/
http://myblog.com/my-blog-post
http://myblog.com/my-blog-post/
Google sees this as 4 different URLs and 4 different pages when in fact it is only one. One of them will rank higher in Google than the rest. This is called canonicalization problem and is discussed by a Google staff here.
Let’s say you get a nice link to http://www.myblog.com/my-blog-post but in fact it is http://www.myblog.com/my-blog-post/ that ranks higher. This link is useless in terms of ranking!
The solution to get all 4 versions made into only one and to have all weight/power transferred to that one
Add the following lines in the .htaccess file before the WordPress permalinks lines:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^myblog\.com
RewriteRule ^(.*)$ http://www.myblog.com/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.myblog.com/$1/ [L,R=301]
That will make all posts go to this version: http://www.myblog.com/my-blog-post/
Just replace myblog before you add it and don’t forget to still include the WordPress permalinks section in the .htaccess file.
Let me know any feedback, ideas, comments etc.
Update, November 28 2006
If this does not work or you use the non-www version for your blog you should use the solution provided by Christer Edwards on the comment here.

Jim Westergren is a company owner from Sweden who lives together with his wife and son. Some of his interests are SEO, web development, writing and
Great post Jim!
I used it!
hi.
wow! real imp info. but could you please let me know wether such a trick can be done for a blogger account.
Hmm. Sorry I don’t know how blogger works. I think WordPress is better.
By the way, yes it is important info. Please tell your friends or blog a link to me
Would this code have to be modified if I was using the Subster Rejuvenation plugin to use wildcard dns to make post category a subdomain?
Russell,
Oh, that I cannot answer to. But if your WordPress post URLs look like the ones above you could try it and see if it works.
Also would be nice if you commented back here on how it went
Excellent article !
Looking for information and found it at this great blog!
Thanks!
Hello! Cool blog, interesting information! Great work, very useful. Thanks you!
Hello!Very nice, beautiful and interesting blog!I enjoy reading your blog … keep it up guys! Respect you!My site: http://handbags.irishost.net
You have a nice blog, I’m visiting it every week. But I swear I saw the same design on Webhosting site a few months ago. Is design for your site 100% made by you?
Dave,
if you see on the footer there is credits to:
http://www.mystical-twilight.com/
She made it originally and a few other ones has it as well.
Thank’s Great post
Looks Good website
http://seo.hitechinfosoft.com
thank you for your work
I’m love this great website. Many thanks guy
thanks, I have just put this inmy blog
Hey what exactly do the permalink lines look like?
Hi Klaas,
like the ones on your new blog.
I mean about this text:
Add the following lines in the .htaccess file before the WordPress permalinks lines:
Oh, ok. You need to download your .htaccess file and you will see. It is 20 lines or something at the end of the file.
could you give me an example of how the lines look like? cause I see lines, but not sure which is the right one and where it should be!
You don’t need to insert any lines as it was done automatically when you enabled the permalinks. They start with this: “# BEGIN WordPress”.
So I have to add this Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^myblog\.com
RewriteRule ^(.*)$ http://www.myblog.com/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.myblog.com/$1/ [L,R=301]
before the BEGIN Wordpress part?
Yes. But replace myblog.com with the domain name of your blog.
I ‘ll tri it with my blog http://www.thai-ebook.com
Jim,
Any thoughts on whether it makes sense to use URLs of this format
http://www.myblog.com/index.php/my-blog-post
instead of
http://www.myblog.com/?p=123
I ask because I’ve got a WordPress blog on Microsoft’s IIS which doesn’t support rewrites without a special plug-in that my host won’t install. I’d like to do what’s best from an SEO perspective, but the variation with index.php looks messy.
“http://www.myblog.com/index.php/my-blog-post” would be better as you then get the KWs in the URL but it is not a critical point, you decide.
Dont you think filename.html would help more?
Is this considered a 301 or 302 redirect?
301 of course!
I noticed that code caused errors on my server. I’m not sure what is configured differently but I had to use the following:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond ${HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^christeredwards\.com
RewriteRule (.*) http://christeredwards.com/$1 [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule (.*) http://christeredwards.com/$1/ [L,R=301]
This redirects to http://domain.com/some-folder/ (instead of the example above that includes the www.
Jim I’m curious on your feelings about the difference in using the www vs non-www domain addresses. I recently wrote a quick post about it and I’d love some more feedback on the issue. It seems to be somewhat controversial from some of the feedback I’ve got so far. Your thoughts?
http://christeredwards.com/proper-method-of-linking-www-non-www/
Hi Christer,
The www-version is slightly better. WHY?
It is the most common version and when you get natural links from people on the top of their head (no cut and paste of URLs) they tend to link to the www-version.
But if you started with one version – stick to it.
In some cases such as digg.com and other web 2.0 sites it would be better without www as you have a short domain and when you are that big people will learn and know which version you are using.
In 5 years from now it might be the other way around – I don’t know.
Just my 2 cents.
Thanks! I tried your trick on my site http://www.softwaredriverdownload.com and now it is working perfectly diverting all non-www to url with www
Thanks and keep up the good work!
I think the way I set this up with my host automatically does the conversion, just in reverse. All http://www.netexperienced.com traffic switches to read http://netexperienced.com…you say stick with this, so I will, but am I missing out on link juice from people who link to me by http://www.netexperienced.com? I wasn’t totally clear. Thanks!
Mike
Nice post Jim.. I just read a complementary article on askapache about using robots.txt to control google.
http://www.askapache.com/2007/seo/seo-with-robotstxt.html
Thanks John and very nice site you have. I have bookmarked it for later study/reference.
.
hi,
i have my blog on http://www.webee.ro/webeeblog. and i have set a permanent redirect:
from www[.]root domain[.] ro to www[.]rootdomain[.]ro/webeeblog
should i replace myblog.com with the root domain, or with the www[.]rootdomain[.]ro/webeeblog?
thanks for help,
webee.
Hey Jim,
This is great info, but I’ve been having a problem when I find great tips like this for WordPress blogs. They are all written as if you are hosting on an Apache server.
There’s where my problem lies. I host my blog on an IIS server. Any idea how to do this with an IIS server since it doesn’t use a .htaccess file?
The other thing I’m trying to figure out is how to change my permalinks to NOT include /index.php/%post name%/. I just want /%post name%/. But the workaround I’ve found for this also includes instructions with a .htaccess.
Any help would be appreciated! You’ll definitely get a link back to your site WITHOUT a nofollow. =)
I tried this but when I try to login to my wordpress admin, it redirects to a 404. Any ideas?
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sophistishe\.org
RewriteRule ^(.*)$ http://www.sophistishe.org/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.sophistishe.org/$1/ [L,R=301]
webee,
As I see it you have the blog in the root of the domain?
Eddie,
Well, what about moving to an Apache server? I don’t know the answers to your questions and I am not even sure if it is possible.
Sheena,
Did you keep the lines that was placed there by WordPress for the permalinks?
Thanks so much for making this accessible. I’ve been looking all over for this redirect to avoid the canonicalization issue.
I’m in SEO myself, but fairly new to the blogger scene. So this is great stuff.
I sure did. The code:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sophistishe\.org
RewriteRule ^(.*)$ http://www.sophistishe.org/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.sophistishe.org/$1/ [L,R=301]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
What’s the right code if the blog is into a subdir? (For example: http://www.mywebsite.com/blog/).
Thanks!
Excellent Aricle my Friend
Could you send me the html code that this would look like on a blog. I understand what you have said but still not to sure where or how you put it in.
I am lacking some of the understanding. Can this nofollow ad in be done in text rather than html?
Tremendous article, you found somthing that many of us did not know and thanks again.
Randy Gibbons
this is the tips that all wordpress user should know
I set my perma links to look like this: http://myblog.com/my-blog-post and in my htaccesss wordpress inserted:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
To use your trick do I keep the code that wordpress gave me or delte it and insert what you’ve posted. I think I’m getting an error because I pasted the code that you provided on top of what wordpress provided to it looks like this:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sophistishe\.org
RewriteRule ^(.*)$ http://www.sophistishe.org/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.sophistishe.org/$1/ [L,R=301]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Turns out I had to use Christer Edwards’ code. It works fine now!
Sheena – what code are you using now for your .htaccess I’m a simliar issue. My post names are not working correctly and I assume it’s .htaccess related.
Thanks a million, it worked and hope to see my pages back from the supplemental results in google
Nifty. Thanks for the info.
Hi, I would like to know how to set the code if the blog is into a subdirectory like http://www.mysite.com/myblog/.
What should I change?
Thanks in advance.
Thanks for the tip, I use it on my blog and it works great, thanks. I have similar question with Tommaso, I’d like to know how to write it on a sub domain blog, http://blog.domain.com
I have several blogs on free hosting with that URL.
Thanks again.
Hi all,
My blog is in a subfolder not on the root domain as the above examples so I am also wondering how to modify this code slightly to work for the extra /blog/ subfolder – could anyone explain?
I’ve tried a few variations of the above codes adding /blog/ onto the root domain but it gives internal errors. My perma links are set as: http://www.myblog.com/blog/my-blog-post
Hoping for some direction… thank you,
I also get errors and my blog is under /blog/. Any suggestions?
//Andreas
Great post. Thanks! But Help–
I changed the file as suggested, but now my photos don’t work. Should I just reload them, or is this a sign of something wrong? It’s at http://www.holisticmaine.com
Thanks!!
**************** TIP *********************
Hi guys I just logged in to say that after changing the .htaccess from the non-www version to the www version I started to have a series of problems editing posts, deleting or adding categories, etc. (I’m using WP v2.2)
After 48 hours of intense editing and customization I realized there was a problem and the thought of doing everything again .. made me wanna puke …
***The problem:
When you try to add a category the “add category” button does nothing and the information entered dissapears.
Trying to add a category from a post shows the same problems.
***Solution:
Grab a beer and Chillax!…then read the following explanation:
The problem seems to be caused by the .htaccess modification in order to push the .www version of your blog.
Simply go to OPTIONS>>>GENERAL and change your wordpress and blog address (URL) to the www version.
I’m having the same issue, as my blog is in a subdirectory mysite/blog
mysite.com/blog/ works fine but I get an error when trying to load mysite.com/blog
Any suggestions?
Gracias!
Hi Jim,
My site doesn’t use the http://www.myblog.com/my-blog-post/ style links, it uses http://www.myblog.com/2007/06/18/my-blog-post/. You mentioned somewhere else that if it wasn’t a new site DON’T change this. Does this mean that I can’t place this code before the links code in the .htaccess file? I’m really worried about breaking my site but also worried about messing up Google chances!
Lovely blog – thanks.
I can’t get this to work on my site that is hosted in a sub directory – everything works except if you go to articlesnatch.com/blog it doens’t redirect correctly. SO i have removed the lines but here is what i had.
without the comment ## of course
#Options +Indexes
#Options +FollowSymLinks
#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^articlesnatch\.com
#RewriteRule ^(.*)$ http://www.articlesnatch.com/blog/$1 [R=permanent,L]
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_URI} !(.*)/$
#RewriteRule ^(.*)$ http://www.articlesnatch.com/blog/$1/ [L,R=301]
WordPress is far superior. You can add it as a seamless addition to your pages. Ideal for smaller sites wanting more content. Blogger is a waste of time, in my opinion – there are no RSS feeds so no directory listings, which is one of the points of adding content in this way and diversifying keyword space.
What are the lines to add for a subdomain?
You are a HUGE asset to me and I appreciate all you do.
Thanks,
Dave
great information Jim, i will check this at my wordpress 2.2 blog
zooloo
Sweet! Its not enough to just format this in the permalinks setting to custom /blogpost/?
Great site JIm!
the redirect only works if you have the blog it self as the domain name. if you host the blog like http://www.corporateside.com/blog and you are redirecting the non www of the root site to the www version the blog redirect won’t work
Hmm I am actually use a WordPress Blog. But have no idea of this issue. Thanks for the post.
Cheers,
hi jim, I set my permalink structure for the post to this : %postname%.html I think it is much easier than editing htaccess file. I dont think anybody will link to my post using an ending slash if they see the html extention at the end of the link.
However, I dont know how it will go with my page or category link.
It seems there’s an unanswered question here. I do have the same problem:
domain.com/blog/
and posts that include the date like
domain.com/blog/index.php/12/12/07/title-of-post
Now I would like to thank for the useful article, but if anybody can solve out this problem i would be happier.
Onre more thing: my .htaccess file is very long. Where should i place the code? exactly here?
# BEGIN WordPress
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ – [S=35]
RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?&feed=$1 [QSA,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?&feed=$1 [QSA,L]
RewriteRule ^page/?([0-9]{1,})/?$ /blog/index.php?&paged=$1 [QSA,L]
RewriteRule ^comments/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/page/?([0-9]{1,})/?$ /blog/index.php?&paged=$1 [QSA,L]
RewriteRule ^search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /blog/index.php?s=$1&paged=$2 [QSA,L]
RewriteRule ^search/(.+)/?$ /blog/index.php?s=$1 [QSA,L]
RewriteRule ^category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ /blog/index.php?category_name=$1&paged=$2 [QSA,L]
RewriteRule ^category/(.+)/?$ /blog/index.php?category_name=$1 [QSA,L]
RewriteRule ^author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^author/([^/]+)/page/?([0-9]{1,})/?$ /blog/index.php?author_name=$1&paged=$2 [QSA,L]
RewriteRule ^author/([^/]+)/?$ /blog/index.php?author_name=$1 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&monthnum=$2&d
ay=$3&feed=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&monthnum=$2&day=$3
&feed=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&paged=
$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /blog/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L
]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /blog/index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$ /blog/index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule ^([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^([0-9]{4})/page/?([0-9]{1,})/?$ /blog/index.php?year=$1&paged=$2 [QSA,L]
RewriteRule ^([0-9]{4})/?$ /blog/index.php?year=$1 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&name=$
4&tb=1 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&month
num=$2&day=$3&name=$4&feed=$5 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /blog/index.php?year=$1&monthnum=$
2&day=$3&name=$4&feed=$5 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$ /blog/index.php?year=$1&monthnum=$2&day=$
3&name=$4&paged=$5 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&name=$
4&page=$5 [QSA,L]
# END WordPress
hello…i have de htaccess set up for: http://www.name.com/post-name
now i copy the code above…but i have this error:
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
my htaccess file looks like:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^cazutdincer\.com
RewriteRule ^(.*)$ http://www.cazutdincer.com/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.cazutdincer.com/$1/ [L,R=301]
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
what i do wrong pls help me!!!
This is for wordpress…What about if i use blogger Jim?
Thank you for your advices.
Nicholas
Hi, Could you please tell me where I would insert the above code. I have put it into my (single post.php) above this line;
<h1 id=”post-”><a href=”" rel=”bookmark” title=”Permanent Link: “>
Can you please tell me if this is correct. I am not sure I am following you regarding .htaccess is this the same thing as what I have done.
Hi Joe,
No that did not work, the code showed up above my post heading.
Any ideas???
Hi, I can’t seem to find this solution anywhere and can’t seem to code it myself…
I’m trying to redirect all http://www.domain.com to subdomain http://sub.domain.com
does anyone know how I can do that?
Thank you!
@jswa, Try this:
Source:
http://act.ualise.com/blogs/continuous-innovation/2008/11/apache-domain-to-subdomain-redirection/
Thanks for providing the code with this information. Very helpful.
Thanks Jim.
I have little question. I have ‘RewriteEngine on’ defined in .htaccess before code you provided. Can this line be eliminated, or I must keep it twice?
@Alex,
Just once is good enough.
Is there a way to test this to make sure it’s doing what it’s supposed to do?
I was change my .htaccess to
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^wayan\.web.id
RewriteRule ^(.*)$ http://www.wayan.web.id/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.wayan.web.id/$1/ [L,R=301]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
But my server says there is some misconfiguration. can you give a solution for my domian??
Hi wayan,
It is hard to say when I don’t have more information. But try deleting line number 4 and 5 and see if it works.
Hi Jim,
Excellent post.
How do I know if it is working fine as without editing my current .htaccess file, all my articles automatically link to http://www.mydomain.com/articles/. Should I need to modify according to your codes? My current .htaccess as below.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
… so when I put my URL at the bottom of my signature when commenting on other people’s blogs, twitter, etc, should I keep the slash on the end of the URL as http://www.mydomain.com/ ? (since my domain will now have the slash at the end of the URL)
@Adam – You should always use / at the of your domain name when link building. The non / is usually 301 redirected to the / version, but you will get link juice leakage.
Jim, I’m new to Wordpress SEO – Is this all still needed in 2009? If yes do you need to add it for every new page created or can 1 bit of code sort everything (and future posts)?
Hi Gereth,
No, this is not anymore needed. It is taken care of in the new version of Wordpress. I have updated the article and thanks for heads up.
Hi Jim,
In my blog I append one .html after the postname.
like http://tutorboy.com/articles/linux/creating-a-playlist-for-mplayer.html
http://tutorboy.com/articles/ is the blog section.
linux is the category name.
is this affect my SEO
, I have some other business related to the the domain so i cant put wordpress in my root, that is why i made a section as articles for wordpress. What do you think is this optimized?
Jim this is what my htaccess file looks like. Is this ok?
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
RewriteCond %{HTTP_HOST} ^mywebsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mywebsite.com$
RewriteRule ^/?$ “http\:\/\/www\.mywebsite\.com” [R=301,L]
Nice Article. After searching Wordpress SEO I landed on your page. I am 100% impressed
is it posiblle that my host does this already through another mechanism? i have noticed that it automaticly redirects to http://mydomain.com/. i don’t have the lines you mentioned in my htaccess file.
if you are using the latest version of wordpress guys then ignore this article. not needed anymore.