Welcome to WebmasterWorld Guest from 23.22.250.113

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirecting folder.with variables in url's

     

siteseo

9:42 pm on Mar 2, 2006 (gmt 0)

10+ Year Member



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

5:56 pm on Mar 3, 2006 (gmt 0)

5+ Year Member



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]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month