April 23, 201214 yr Looking for a bit of help here guys, I have a website that is currently 100% static, part of which is a section containing 1000+ unique individual pages. In the new design that part of the website is now dynamic from a database. Quite a lot of the unique pages are linked around the web and in google results so obviously I want to redirect them to the new site, but what is the best way of doing it? Should I just redirect them to the new index and risk visitors leaving, not bothering to re-navigate to the exact page or is there a way I could direct them all exactly? Probably better to give you an example. Now it's like this: website.com/liveguide/1996/1996-01-03.php website.com/liveguide/2005/2005-05-14.php And so on, an index for each year and hundreds of individual pages. On the new dynamic site it will just be (for those two specific examples) website.com/liveguide/show.php?show=130 website.com/liveguide/show.php?show=753 So as I say, do I redirect all of the pages to website.com/liveguide and hope visitors don't mind finding the individual show again or would there be an automated way to get them to the exact page? The problem I'm thinking with that is I'm not going to create 1000+ separate redirects so maybe I have no choice? I don't know, I've not really looked into redirecting after a redesign before.
April 23, 201214 yr I'm not 100% clear on what it is you mean, however I'm guessing that 1996-01-03 equates to 130, which I guess is a unique ID in the database... And the problem you are now having is that users can't navigate to... website.com/liveguide/1996/1996-01-03.php ...because it no longer exists due to the redesign... Could you not use a redirect in .htaccess and take the variable 1996-01-03 and then using that redirect to the page website.com/liveguide/show.php?show=1996-01-03 then using php you could search the data base for 1996-01-03, assuming it is in there somewhere, it must be surely? retrieve the unique ID (130) and then carry on as you are... You would have to put an if else statement such as: $val = $_GET['$i']; // You would need to do a check to see if $val has '-' character in, could do this a number of ways. if (does have - in) { // search that in db and return unique ID $ID = //number returned from db } else (doesn't have - in so must be unique id) $ID = $val } // carry on script as normal This would all happen automatically and you would only need to put one line of code to make the redirect work for all scenarios, would that help you out at all? Edited April 23, 201214 yr by adamsmith
April 23, 201214 yr Or, instead you could make your SQL query something like this SELECT * FROM table WHERE ID = $val (130) OR YEAR = $val (1996-01-03);
April 24, 201214 yr Author Sorry I probably wasn't clear enough, I do tend to have a habit of rambling without being very clear. Anyway those two urls were just an example. Maybe it would be clearer to look at the real site. This is the current version that is still live as of now: http://www.foofighterslive.com/liveguide/ As you can see you can click on a year and then from the year page click on any one of the dates. Now the new dynamic version, not live yet: http://www.simonkilmore.co.uk/ffl2/liveguide/ So now you click through to years through one years.php file and then from the years you're just clicking to one show page with the unique id for each show. I didn't create the database and php to go with it, my friend did so I'm not 100% sure on how it's working but I can ask him of course. All I know is he basically combed my current site for data and created a unique id for each show in order. So the first one in 1995 is show 1, the last one in 2011 is show 1093. In the database for each unique show there is obviously the date from the show within but I'm not sure how easy it would be to match from the old URL? Looking at the table data in phpMyAdmin I can see he's got the date for the show in YYYY-MM-DD format, which is the same as the current file naming scheme. So I think you probably were going along the right lines in your first post. Edited April 24, 201214 yr by Killer
Create an account or sign in to comment