301 redirect or PHP redirect?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blade_922
Forum Contributor
Posts: 132
Joined: Wed Jul 12, 2006 4:57 pm

301 redirect or PHP redirect?

Post by blade_922 »

Hey guys,

I have been told this can be done in 2 ways either with the .htaccess file or via a PHP File redirecting the URL's.

Im using joomla cms and the URL's to the articles are:

http://www.mysite.com/pspnews/articletitle/


Ok so im moving to wordpress and there the URL's are:

http://www.mysite.com/dd/mm/yy/articletitle/


dd/mm/yy/ being the date month and year of article.


How on earth would i do this and redirect all the articles to the new location? I've been struggling to get this for days. Most people have said its best via PHP so as to read the article date, but i have no idea how.

Anyone help me out?

Regards
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think I might create a "pspnews/articletitle/index.php" script that redirects the old URLs to the new ones. For the mappings, you could use a big array if there aren't too many or create a database table from the two systems to hold the mappings.
(#10850)
blade_922
Forum Contributor
Posts: 132
Joined: Wed Jul 12, 2006 4:57 pm

Post by blade_922 »

I have no idea what that all means. Or how on earth to do it. Can you start me off with the code a little anyone :)

regards
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

header() redirection.
Post Reply