Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Redirect http and POST with mod-rewrite


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


Thread source:: http://www.webmasterworld.com/apache/3563783.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com