Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect http and POST with mod-rewrite


Markus Klaffke

12:44 pm on Feb 1, 2008 (gmt 0)

10+ Year Member

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_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]


6:24 pm on Feb 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member


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


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

Markus Klaffke

6:00 pm on Feb 5, 2008 (gmt 0)

10+ Year Member

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.

Featured Threads

Hot Threads This Week

Hot Threads This Month