homepage Welcome to WebmasterWorld Guest from 54.211.95.201
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Redirect Users from deleted folder to homepage using .htaccess
XMLMania




msg:1500347
 7:10 pm on Jan 15, 2004 (gmt 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!

 

jdMorgan




msg:1500348
 3:25 am on Jan 17, 2004 (gmt 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

XMLMania




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

Cheers! Very useful info

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved