I am trying to figure out how to make it so that if a user types in a url and gets a 404 error message, they get routed to wordpress to see if it can figure out the url.
Currently I have a site
xyz.com where it is a wordpress site. I am designing a replacement where xyz.com will be a codeigniter site. I will keep the wordpress part xyz.com/blog will be wordpress.
I would like the old urls that are on search engines to be able to redirect to the blog that still has the same data as before, but is now under /blog.
What would be the best way to accomplish this.
Thanks
This would send any 404s to a custom “/error” controller, along with the original requested uri string:
the controller could then get the URI string, add “/blog/” in front of it, and check if the file exists. If it does, redirect… if not, go to another error page. So in the controller “error”:
I hope that helps!
update: originally thought to use htaccess, but since everything in CI goes through, index.php…. that really isn’t needed.