Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect Users from deleted folder to homepage using .htaccess

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

Junior Member

10+ Year Member

joined:Nov 2, 2003
posts:95
votes: 0


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!

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

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


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

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

Junior Member

10+ Year Member

joined:Nov 2, 2003
posts:95
votes: 0


Cheers! Very useful info
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members