404 missing pages - how to control dynamically?
Posted: Tue Aug 12, 2014 3:26 am
Hi.
The people who manage the sites I run sometimes change categories names, sometimes even update product IDs, and because of that, you do get URLs cached by Google (and others) that become redundant.
All these sites run from their own index.php template. So how do you identify, perhaps in index.php if the productID queried exists, and if not, take them to perhaps a 404 Error page that Google sees as a 404 or a 301?
We can manually change and do 301s in htaccess via a CSV export and just point them all to a page. But be better if it did this dynamically.
Web sites must do this kind of thing all the time, specially with sites that customers "run" (ebay, amazon, Facebook etc).
Index looks for the ID, it doesn't exist, so goes to a error.inc file. But Google doesn't see that file as a 404 or 301 direction. So how do you do that?
Can you query a database via htaccess and if the ID doesn't exist, do a 301??
The people who manage the sites I run sometimes change categories names, sometimes even update product IDs, and because of that, you do get URLs cached by Google (and others) that become redundant.
All these sites run from their own index.php template. So how do you identify, perhaps in index.php if the productID queried exists, and if not, take them to perhaps a 404 Error page that Google sees as a 404 or a 301?
We can manually change and do 301s in htaccess via a CSV export and just point them all to a page. But be better if it did this dynamically.
Web sites must do this kind of thing all the time, specially with sites that customers "run" (ebay, amazon, Facebook etc).
Index looks for the ID, it doesn't exist, so goes to a error.inc file. But Google doesn't see that file as a 404 or 301 direction. So how do you do that?
Can you query a database via htaccess and if the ID doesn't exist, do a 301??