homepage Welcome to WebmasterWorld Guest from 54.237.95.6
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
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
siteseo




msg:1498562
 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:
www.example.com/old-folder/file.php?prod=1556

 

extras




msg:1498563
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved