I've just transformed my page structure from





however all cached pages on search engines like google gives 404..

how do i handle them? can you really redirect all 404 to straight to the domain www.domain.com as well as in exactly the same tiem send back a 301 redirect towards the internet search engine?

Try the next in htaccess (if available) or even the virtual host's config:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*\.php$ /$1/[R=301,L]