February 27, 201412 yr Hey guys, I'm currently in the final processes of completely redesigning and rebuilding a fairly big website. One of those last things I need to do are redirects but I could do with a little help.The main changes are moving one section from static pages to a database design. This is the current site and section - http://www.foofighterslive.com/liveguide/ As you can see it's all static with an index page for each year and a single, static page for each show, all with a unique URL. The new, database driven site will be like this: www.foofighterslive.com/liveguide www.foofighterslive.com/liveguide/year.php?year=1996 www.foofighterslive.com/liveguide/show.php?show=152 Since having them all redirect to the right show ID would surely be impossible what I'd ideally like to do is a have a redirect so ANY page that is currently a subpage of a year just redirects to the new year index, ie: www.foofighterslive.com/liveguide/1995/1995-02-23.php www.foofighterslive.com/liveguide/1995/1995-04-27.php Would both redirect to www.foofighterslive.com/liveguide/year.php?year=1995 And www.foofighterslive.com/liveguide/2002/2002-02-07.php Would redirect to www.foofighterslive.com/liveguide/year.php?year=2002 The year pages would also be slightly different, so www.foofighterslive.com/liveguide/?id=1995 > www.foofighterslive.com/liveguide/year.php?year=1995 The same for each year. Is that possible and if so how would I go about it? Thanks Edited February 27, 201412 yr by Killer
February 27, 201412 yr Try this in .htaccess: RewriteEngine On RewriteRule ^\/liveguide\/(\?id\=)?([0-9]{4}).*$ /liveguide/year.php?year=$2 [R=301,L]
Create an account or sign in to comment