homepage Welcome to WebmasterWorld Guest from 54.237.98.229
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 http and POST with mod-rewrite
Markus Klaffke

10+ Year Member



 
Msg#: 3563783 posted 12:44 pm on Feb 1, 2008 (gmt 0)

Have here a problem with some mod-rewrite lines. I want POST and search query request not to be served out of the cache, but what i have does not work. POST requests are still ignored and served as http request. Is there a mistake in my code?

RewriteEngine on

#
# Ensure that POST requests and requests with query strings are not
# served from the cache.
#
RewriteCond %{QUERY_STRING}"!^$"[OR]
RewriteCond %{REQUEST_METHOD}"POST"[NC]
RewriteCond %{REQUEST_URI}"!^/cms/\w+.cgi"
RewriteRule (.*) /cms/gateway.cgi/$1[PT]

#
# Redirect all missing files to the CGI script
#
RewriteCond %{REQUEST_FILENAME}!-s
RewriteCond %{REQUEST_FILENAME}/index.html!-s
RewriteRule (.*) /cms/gateway.cgi/$1 [PT]

 

Birdman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3563783 posted 6:24 pm on Feb 2, 2008 (gmt 0)

Hi,

I would say remove the double quotes and them try it again, they definately don't belong.

Marty

[edited by: Birdman at 6:25 pm (utc) on Feb. 2, 2008]

Markus Klaffke

10+ Year Member



 
Msg#: 3563783 posted 6:00 pm on Feb 5, 2008 (gmt 0)

Thanks Marty. Sorry but had nothing to do with the quotes. The code itself is okay. The problem was how to access my gateway script. I fixed this now.

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