WP permalink structure
2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 30, 2012 (RSS)
By Toledoh - May 29, 2012
Hi guys,
I'm about to launch a new site that is replacing on old Word Press blog.
I'm manually copying all the articles over, then will redirect the wordpress site to the new URL. (They offer a service for this http://en.support.wordpress.com/site-redirect/)
However, for all the old permalinks to work with the redirection (which would be nice) I have to use the same permalink structure as wordpress.
If I have an article with the title: "Title Goes Here" and published on 2nd Jan 2012, how do I get the following link;
www.newdomain.com/2012/01/02/title-goes-here
to match the old WP link of;
www.domain.wordpress.com/2012/01/02/title-goes-here
I'm about to launch a new site that is replacing on old Word Press blog.
I'm manually copying all the articles over, then will redirect the wordpress site to the new URL. (They offer a service for this http://en.support.wordpress.com/site-redirect/)
However, for all the old permalinks to work with the redirection (which would be nice) I have to use the same permalink structure as wordpress.
If I have an article with the title: "Title Goes Here" and published on 2nd Jan 2012, how do I get the following link;
www.newdomain.com/2012/01/02/title-goes-here
to match the old WP link of;
www.domain.wordpress.com/2012/01/02/title-goes-here
Cheers,
Tim (toledoh.com.au)
Tim (toledoh.com.au)
Re: [Toledoh] WP permalink structure
By Jason - May 30, 2012
Hi Tim,
That shouldn't be a problem. These types of URLs can be easily be generated on the fly using PHP.
For example:
The trick is setting up your htaccess to redirect this type of link to the appropriate page, and how you want to structure your query to retrieve that record.
This should help you get started:
http://www.seocentro.com/articles/apache/mod_rewrite-create-search-engine-friendly-urls.html
Hope this helps
That shouldn't be a problem. These types of URLs can be easily be generated on the fly using PHP.
For example:
$recordDate = strotime($record['createdDate']);
$url = "www.newdomain.com/".date("Y", $recordDate)."/".date("m", $recordDate)."/".date("d", $recordDate)."/".getFilenameFieldValue($record, 'title');
The trick is setting up your htaccess to redirect this type of link to the appropriate page, and how you want to structure your query to retrieve that record.
This should help you get started:
http://www.seocentro.com/articles/apache/mod_rewrite-create-search-engine-friendly-urls.html
Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/