homepage Welcome to WebmasterWorld Guest from 54.237.125.89
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
RedirectMatch and Dump Query Strings
jk3210




msg:4476290
 3:39 am on Jul 17, 2012 (gmt 0)

I'm trying to redirect everything in the "foo" directory and below, to a file. This works...


redirectMatch 301 ^/foo/ http://www.example.com/filename/

...except it also appends any query strings found in "/foo/" to "/filename/"...which results in "/filename/?=true" not just /filename/.

How do I make sure any query strings get stripped from the redirect?

 

g1smd




msg:4476335
 6:27 am on Jul 17, 2012 (gmt 0)

Use a RewriteRule instead and add a question mark to the end of the target URL.

Convert all of your rules that use Redirect or RedirectMatch to instead use RewriteRule.

jk3210




msg:4476422
 1:34 pm on Jul 17, 2012 (gmt 0)

Got it. Thanks g1smd.

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