Julian Klewes

Changing Permalink structure (removing datestamp)

This article was posted in SeptemberJanuary 4, 2006







If you used the default permalink structure,
you’d have something similar to:

/%year%/%monthnum%/
%postname%/

now say you want to get rid of the dates
(maybe seo-wise driven?)
you’d have

/%year%/%postname%/

But now all your posts (and post slugs) are outdated,
thus returning 404 or if you got the right
redirection rules return you to some error document.
That’s exactly what I did and troubled with.
Now there is this guy scotty from fucoder.com
who is a real genius.
He told me to solve this problem by
by adding an extra Mod_Rewrite rule before the rules
generated by WordPress.
In my case:

RewriteRule ^([0-9]{4})/
([0-9]{1,2})/([0-9]{1,2})/
([^/]+)/?$ /$4/ [L,R=301]

He told me to put that right after RewriteBase
to install this redirection and it worked wonders.
Thanks scotty!

Vielleicht auch fuer einige interessant ist dieser Artikel ?ber das Aendern von Permalinks in Wordpress (alte uri /archiv/ neue /)

If you enjoyed this post, make sure you subscribe to my RSS feed!

share me please

h4x3d.com does not host any illegal content. Links/Files referred to are for educational purposes only.

Interact - Leave a comment

Engage in the conversion and leave a comment.
I would much love to hear from you. Please note however that comments are moderated by default. Advertising and rant is welcomed, yet often discarded...
See left/right for additional information













comment? jump to the form



archives | sitemap | contact | tos

Top
advertise
advertise

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

solarVPS.com - reliale enterprise hosting
you know the game, get in touch with me
3