I needed to move a Content management systems to some subfolder. consequently, the URL held in search engines like google are going to damaged link.

things i did to resolve the issue is coding a webpage with PHP as 404 page that will get the damaged link, repair it, after which, redirects towards the true page quickly .. or, it'll just indicate the index page.

But, regrettably, I face difficult time attempting to make it the default 404 page within an Apache server. It simply will not, I attempted some .haccess methods however they keep redirecting without delivering the asked for Hyperlink to (404.php) to become fixed ..

I attempted to incorporate the code within the 404.shtml, however it will not work ethier.

what all I would like would be to be aware of asked for URL to ensure that I'm able to handle it ..

any idea?

Use mod_rewrite.