Welcome to WebmasterWorld Guest from 54.226.62.26

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect Users from deleted folder to homepage using .htaccess

     

XMLMania

7:10 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



Hi

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!

jdMorgan

3:25 am on Jan 17, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



XMLMania,

> 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

XMLMania

10:35 am on Jan 17, 2004 (gmt 0)

10+ Year Member



Cheers! Very useful info
 

Featured Threads

Hot Threads This Week

Hot Threads This Month