Welcome to WebmasterWorld Guest from 54.198.200.120

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect http and POST with mod-rewrite

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

New User

10+ Year Member

joined:Oct 15, 2003
posts:28
votes: 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]

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 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]

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

New User

10+ Year Member

joined:Oct 15, 2003
posts:28
votes: 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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members