301 Redirect through PHP in Wordpress

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
pro101
Forum Newbie
Posts: 1
Joined: Sat Feb 07, 2009 2:08 pm

301 Redirect through PHP in Wordpress

Post by pro101 »

Hi all,

I've recently discovered that using /%postname%/ only for permalinks on posts in Wordpress is not scalable. My site has currently a small number of posts (25) and about 35 pages. Likely I will eventually have 100s of posts, so before it's too late it seems I need to change Permalinks.

Initially tried to look into htaccess rewrite, but Apache experts said that htaccess can't know postid, so the 301 redirect needs to be done through PHP script.

Anyone knows what I need to change in wordpress to redirect from:
from domain.com/postname
to domain.com/postid/postname

It would help a lot. Thanks in advance.
Post Reply