Forum Moderators: phranque
The situation is that I have recently deleted a folder which was a directory which many people used. I get lots of errors each day with "ERROR 404 not found".
I want to redirect: domain.com/dir/ TO domain.com
I would like it so that any other URL from the directory folder is also redirected.
E.g. domain.com/dir/ANYTHING-HERE.php?SOMETHING=ANYTHING
Does anyone know how to do this? And is it possible to redirect using .htaccess from a folder that doesn't exist on the server?
Thanks!
> Is it possible to redirect using .htaccess from a folder that doesn't exist on the server?
Yes, your problem is very easy to solve using .htaccess. Here's a good place to start: Introduction to mod_rewrite [webmasterworld.com]
You can put the redirect into the top-level directory of the site (web root), and it will redirect the requests for the missing subdirectory. You can use either mod_alias or mod_rewrite to accomplish this. mod_alias is simpler, mod_rewrite more complex and powerful.
Jim