homepage Welcome to WebmasterWorld Guest from
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

Redirecting folder.with variables in url's

10+ Year Member

Msg#: 5691 posted 9:42 pm on Mar 2, 2006 (gmt 0)

I'm trying to figure out how to redirect an entire folder (now defunct) to my home page. The tricky part is, some of the files in that folder are indexed with variables as part of the URL's. Is there a way to redirect calls for ANYTHING within the folder, to the home page? Here's what I've tried with no success, along with several variations:

RewriteRule ^old-folder/(.*)$ [domain.com...] [R=301,L]

Here's a sample URL that I'm trying to redirect:



5+ Year Member

Msg#: 5691 posted 5:56 pm on Mar 3, 2006 (gmt 0)

The QUERY_STRING (what you called 'variable') will follow unchanged.
But you need to include subdirectory and/or file name.

RewriteRule ^old-folder/(.*)$ [domain.com...] [R=301,L]

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