How to configure WordPress to create search engine friendly URLs for permalinks
Wednesday, August 25th, 2004 at
7:22 pm
Filed under: blogging • SEO • Weblogs • WordPress
Like this post? Subscribe to my RSS feed and get loads more!




Wow, thank you so much, finally an explanation in layman’s terms (or layperson if you prefer!). My permalinks are SEARCH ENGINE FRIENDLY – YIPPEE!!
Had some tricky moments where I accidentally made my whole blog password protected with an htaccess mistake, but I’m still learning.
Hey this is a great post even for newbies.
I’m just considering moving from Blogger to WordPress on my Hosting server.
As a new blogger. I’m presuming that it’s better to get all this stuff setup before posting for the very first time, to aviod the pitfalls?
Does anyone kknow if it’s possible to “export” my whole blog from Blogger to WordPress?
Thanks
Steve
I’ve added permalinks to my wordpress blog, and they seem to be working fine. One thing that bothers me is that when you click into a post the url still shows an ID number. Note the (7) in the following URL: http://www.swimming-pool-store.com/supplies/7/swimming-pool-supplies/
I realise that this seven corresponds to the order in which the post was made. Is it possible to remove these numbers? Or have I made a mistake when I installed permalinks?
Thanks
John
Thanks, works great for me on one of the sites I’m playing around with. Really simple solution to set up.
Thanks for the guide.
I need help on :
1) The title of the page to contain the post subject. How to modify the theme?
2) Archive Month links are showing only http://mywebdomain.com/%postname
Thank you
Here is the fix for page not found problem , “The requested URL /blog/archives/testing-wordpress/ was not found on this server.” More info can be found at http://www.kamranzaidi.com
You have to unable the mod_rewrite in your apache http.conf file. Step 1: Go to your apache conf directory , $APACHE/apache/conf
Step 2: Edit httpd.conf file.
Step 3: Search for “Dynamic Shared Object (DSO) Support” section
Step 4: Unable loading of rewrite mod by removing # sign from this line LoadModule rewrite_module modules/mod_rewrite.so
Step 5: Search for “AddModule mod_rewrite.c” and unable it by removing # sign.
Step 6: save and restart your apache server.
Step 7: Try again , now you should be able to view pages
Hopefully it ll work.
Thanks
Only thing not working now is archives –
I get 404.
The requested URL /2006/09/ was not found on this server.
Categories and pages both – pages give the /title/
the URL for this custom wordpress blog is at client’s http://www.electronicsleader.net
Thanks, I was looking for this!
Great tutorial!
Thanks for informaton, this is the first time to I see the content of the .htaccess file. I never bothered about it before I read your post.
I don’t know anything about .htaccess files but managed to set the permalinks using WP control panel. Is it neccessary or advisable to mess around with the .htaccess file?
I have an important question, maybe this post is quite old but i want fancy URL like domain.com/something-myblog. but currently it appears something like /?=234 but i don’t want like this. So what i did is i copied the above lines to my .htaccess file, but question is here i’m using new WP version and i don’t have above option in admin .. permalinks. Please advice what should i do to avail that feature? Thanks
Syed Networks: Try this
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Hugs and kisses……
Its working…thanks a ton
Regards
Kiviniar
p.s.i can sleep a relieved man
Thanks, works great for me on my site.
Great post.
I was using the default option of wordpress, till web savvy friend pointed out that I should make my blog SEO friendly. Found you through the wordpress codex.
Thanks for the .htaccess file, I was could not cook that up!
previously my permalink structure is something like /%category%/%postname%/
and i want to change it to /%postname%/ only, how can i do that such that old post should be redirected to the new one.
I’m just starting to tinker with this stuff, this post has been extremely helpful. THANKS!
Thanks for the info, Emily. One question: how did you manage to put the number of readers by Feed Burner into WordPress?
hello. i’m used
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
on my wordpress mu v1.0 it’s working but subdirectories images not shown and i used users have a symbolic subdirectory. but not working.
i tried also
RewriteEngine On
RewriteBase /
RewriteRule ^category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^category/?(.*) /index.php?category_name=$1 [QSA]
RewriteRule ^author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^author/?(.*) /index.php?author_name=$1 [QSA]
RewriteRule ^([_0-9a-z-]+).htm([0-9]+)?/?$ /index.php?name=$1&page=$2 [QSA]
RewriteRule ^([_0-9a-z-]+).htm/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?name=$1&feed=$2 [QSA]
RewriteRule ^([_0-9a-z-]+).htm/trackback/?$ /wp-trackback.php?name=$1 [QSA]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]
but not working for my blog system.
i don’t understand mu.
thank you
Very helpful. Thanks a lot. I’m new to wordpress so I need all the tips I can get. I’m now going to scour your site for answers to other questions I have.
Albert
http://laowaichinese.net
PS: the leave a comment form is very confusing. I wasn’t sure what goes where…
I’m using the E-commerce plugin from http://www.instinct.co.nz/e-commerce/16 and I’d like to change it to use permalinks.
For example instead of:
catalog?category=4
the link would be
catalog/caregory_slug
I’ve already changed the code, so the links are shown this way, I added to every category a slug in the DB.
The problem is that I don’t know what to change in the .htaccess or WP code in order to tell WP that all the URLs that match ^catalog/ should be treated as it was catalog?…
This is what I tried:
RewriteRule ^catalog/([^/]*)/?$ /catalog?category_slug=$1 [L]
RewriteRule ^catalog/([^/]*)/([^/]*)/?$ /catalog?category_slug=$1&subcategory_slug=$2 [L]
Even when I try the next rule for testing:
RewriteRule ^catalog/([^/]*)/([^/]*)/?$ /index.php?p=4&category_slug=$1&subcategory_slug=$2 [L]
I get the default error page: Sorry, but you are looking for something that isn’t here.
I’d really appriciate any help / hint / example to see how can I hack WP to use permalinks in this case.
Thanks
Great Sruff!
Thanks…….
It is wrong that the search engines dont crawl deeper pages. The crawling is totally depending on your linking structures. One of an example is about.com. Beside this there are many other references which proves that the search engine crawler can crawl deeply. It totally depends on your link structure. Suppose you give the links of your deeper pages at your home page then the crawler must crawl these pages following the links. The crawler follows the link not the pages hierarchy. At the end i must say in your permalink if you choose the structures or tags which have key words then it would be an advantage.
Zeus Web Sever Request Rewriting->Enabling Request Rewriting Enabled
Rewrite Script
Enter the rewrite script here:
RULE_0_START:
match URL into $ with /category/(.*)/(feed|rdf|rss|rss2|atom)/?$
if not matched then goto RULE_0_END
set URL = /wp-feed.php?category_name=$1&feed=$2
goto END
RULE_0_END:
RULE_1_START:
#match URL into $ with /category/([_a-z-]+\/)+$
match URL into $ with /category/?(.*)
if not matched then goto RULE_1_END
set URL = /index.php?category_name=$1
goto END
RULE_1_END:
RULE_2_START:
match URL into $ with /author/(.*)/(feed|rdf|rss|rss2|atom)/?$
if not matched then goto RULE_2_END
set URL = /wp-feed.php?author_name=$1&feed=$2
goto END
RULE_2_END:
RULE_3_START:
match URL into $ with author/?(.*)
if not matched then goto RULE_3_END
set URL = /index.php?author_name=$1
goto END
RULE_3_END:
RULE_4_START:
match URL into $ with ([_0-9a-z-]+).html([0-9]+)?/?$
if not matched then goto RULE_4_END
set URL = /index.php?name=$1&page=$2
goto END
RULE_4_END:
RULE_5_START:
match URL into $ with ([_0-9a-z-]+).html/(feed|rdf|rss|rss2|atom)/?$
if not matched then goto RULE_5_END
set URL = /wp-feed.php?name=$1&feed=$2
goto END
RULE_5_END:
RULE_6_START:
match URL into $ with ([_0-9a-z-]+).html/trackback/?$
if not matched then goto RULE_6_END
set URL = /wp-trackback.php?name=$1
goto END
RULE_6_END:
RULE_7_START:
match URL into $ with comments/feed/?([_0-9a-z-]+)?/?$
if not matched then goto RULE_7_END
set URL = /wp-feed.php?feed=$1&withcomments=1
goto END
RULE_7_END:
RULE_8_START:
match URL into $ with feed/?([_0-9a-z-]+)?/?$
if not matched then goto RULE_8_END
set URL = /wp-feed.php?feed=$1
goto END
RULE_8_END:
RULE_11_START:
match URL into $ with ([0-9]+)\/([0-9]+)\/(([0-9]+)\/)?$
if not matched then goto RULE_11_END
set URL = /index.php?m=$1$2$3
goto END
RULE_11_END:
Iam using wordpress2. In this blog you mentioned “Use the template tags above to create a virtual site structure”. But I do not have this option. The options I have : Options>>permalinks andunder permalinis there are two catagories: (1) Common Options (2) Optional. Under (1) Common Options the edit options are:
__________________________________
Default
http://www.yoursitename.com/?p=123
__________________________________
Date and name based
http://www.yoursitename.com/index.php/2007/01/14/sample-post/
__________________________________
Numeric
http://www.yoursitename.com/index.php/archives/123
__________________________________
Custom, specify below
__________________________________
Under Optional:
Catagory Base
__________________________________
I could not see the sentence “Use the template tags above to create a virtual site structure” to edit with /%postname%.htm
Can you please guide me?
Thanks and regards.
Worked like a charm! Thanks so much Emily, working on my second post at http://www.337design.com/blog.
Is it better for SEO reasons to put it at blog.337design.com? Thanks for your help, Ben
Hi! .. I was just wondering, why did you insert .htm behind the postname?
I’ve seen many people just use /%postname%/ alone.
Is there any difference?
Nice Article, but this is now deprecated in favor of using the following and having wordpress take over.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
http://www.askapache.com/2006/htaccess/htaccesselite-ultimate-htaccess-article.html
Thankyou very much for putting this up, I was actually looking for a permalinks solution, and it turned out this was the one thing I was after !
thanks a bunch !
peace
-mE
Hi,
how to rewrite the mod wp for my blog without losing the previous feeds?
my blog
my blog on Home Based Business
Thank you so much! I looked for an explanation of the permalinks in WordPress and found your instructions .. very thorough and easy to follow. Thanks again !
Very helpful, I went with post name and post id followed by .htm
Thank you for clarifying a few things for me that aren’t so clear in the wordpress codex, wish i would have ended up here first off.
WHEW…thanks! I have been trying to do this all day. Yours is the first bit of information I have found to make it easy. I wish I’d read this first before wasting hours!!
Hello Emily,thanks for this post, very useful.
I’m just not sure is there any difference between /%postname%-%post_id%.htm and /%postname%-%post_id%.html ??
Would you please let me know your idea which is better .htm or .html? It seams quite a lot of websites have .html now. But I really have no idea. Does it matters about the extensions?
Thanks.
To the last few commentors: This post is a few years old, so some of it is outdated and easier to do with newer WP versions and plugins.
To Yan: The extensions (.htm) and (.html) are the same thing, it’s just that older computers only allowed 3 character extensions to identify what type of file it is and which programs could access it.
I’m not sure when, but some programs started using 4, and since it has 4 words(hyper text markup language), they started using (.html). I think they’re are semi-compatible, where you can stop at htm on a html page, but not the other way around, but don’t quote me.
B)>
Nice job, I was looking for this exact info, and am glad I found you site so soon. Thanks for the info, I have much more pretty permalinks now! Thanks.
hi
i am new one to php..
now i develop my site using word press.
but i want create my own coding, i want detail about php -permalink.
pls help., me send samples .
thank .
team
‘tamilofun ‘
I’m not new to htaccess or anything, but I just couldn’t figure out how to do this seemingly simple procedure in WordPress. Thank you for your easy to understand post!
I want to create my own codes,and i want details about php -permalink.Thanks, if you can show me!
Thanks
it was more useful than WordPress codex.
I had changed my site, and worked perfect.
except with using %post_id%. It didn’t work for my old posts. but I removed it and used “/%category%/%postname%.htm”.
It works and it seems that it solves the after setup permalink change problem.
thanks for the tips. Also wanted to know how we can replace the /search/ folder in wp with /what-ever/
-DP
it’s works!
Great, thx a lot!
Phew – messed around for days and this did the trick – easier to understand than WordPress help.
Thanks,
Paul.
Well I’m happy to read this article, it’s so nice. Thanks for sharing information buddy.
You have done nice job keep up the work.
thanks for the information the information provided by you is so useful and very informative.
Can anyone tell me if this is possible for “Page” links instead “Posts”?
How would page permalinks be shown with .html extension? Appreciate support from u guys.
hey i cant do that
please help me out
i have changed the name and when i right click on that file in properties chmod there is nothing to be set 666 or what eva… The page cannot be found is still there.. what to do now
I like this post, it is knowledgeable. thanks for sharing
as seo, you must know lots of stuff, backlink is most important
How to identify genuine and fake Rolex?
From the appearance of fine Rolex watch cases, watch straps crown, word clear, complete, and the rough copy form shell; text a
little fuzzy. In particular, end table, covered teeth, very fine and clear, bright and clean with three-dimensional, while the counterfeit
goods without three-dimensional rough, lighter than normal.
Weight, really feeling pragmatic and some, much less fake, (Note: some replica of a copper ring which also included). 18K gold
texture on the case of labor 10, strap, the genuine gold general, and translation quality, color change, counterfeit products have a
lower number of K 14K gold or gold or 18K gold plated, but over time will change back to primary colors. The stars of the Rolex, set
in the form of diamonds are real, and fake goods are fake diamonds. The market also appears true case, strap, which leave the
Rolex movement, it is best to use special tools to open the table.
Rolex movement is really a call to the autopilot, no lettering, engraved ROLET movement plywood words, also engraved with the
movement number: 1570,2135,3135,3 O35 … so there is no fake. Mechanical movement is really fine,