Do you have problem with Wordpress Permalink .htaccess code?
Some of .htaccess rewrite module code drive me crazy for all one day.
After fixed some wordpress theme issue, I must deal with another problem.
There are some problem with URL Rewrite modul in Permalink Structure.
I really stuck with this problem until night.
- Wordpress version 1.5.2 did not support htaccess code generator for us.
- Some of new wordpress users have to handle permalink structure problem
- Wordpress documentation did not required more easy to read about Wordpress URL rewrite
How I solve this problem?
- After browse some sites, I’ve found one usefull link about How to configure WordPress to create search engine friendly URLs for permalinks?
- This code will only works if you put /%postname%.html into permalink structure input form.
- but there is something error that I find after insert this structure.
The problem come from archieve link that list your archieves by year/month/date.
It won’t shows up and redirect you to 404 error page.
To solve this problem, I’ve inserted additional code to new .htaccess line.
To finish my new blog project with perfect permalink, I show you the .htaccess code.
You can copy and paste this code to your .htacess.
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-]+).html([0-9]+)?/?$ /index.php?name=$1&page=$2 [QSA]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$ /index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index.php?year=$1&monthnum=$2&datenum=$3 [QSA,L]
RewriteRule ^([_0-9a-z-]+).html/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?name=$1&feed=$2 [QSA]
RewriteRule ^([_0-9a-z-]+).html/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]
I hope it’s usefull. If something error comes up, please leave some comments.
2 Comments
New Permalink Additional for Wordpress 1.5.2 » Handry Business Journal said,
Pingback • November 20, 2005 @ 5:08 pm
[…] In the problem and solving blog post before, I already mention about Wordpress Permalink htaccess code. […]
RSS feed for comments on this post. TrackBack URI
Leave a comment
You must be logged in to post a comment.




DesrtHawk said,
Comment • November 18, 2005 @ 7:44 pm
Thx for this, it helped on my new site