Forum Moderators: phranque

Message Too Old, No Replies

[.htaccess] - problem getting querystring

         

manuelsechi

9:34 am on May 4, 2007 (gmt 0)

10+ Year Member



hi all

i have a page that redirect to a url like this:

[mydomain.net...]

and in /error i have this .htaccess file

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/error/
RewriteRule (.*) /cgi-bin/error/error.chm?uri=%{REQUEST_URI}&qs=%{QUERY_STRING}

now, in /cgi-bin/error/error.chm, if I print $cgi->param('qs'), I only have ACT=deleted, how can i modify the .htaccess to pass all the querystring?

thanx all for your help
regards
Manuel

jdMorgan

1:30 pm on May 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code should work as-is. You could try this modified version, just to see if it makes any difference:

RewriteEngine on
RewriteRule ^(.*)$ /cgi-bin/error/error.chm?uri=$1&qs=%{QUERY_STRING} [L]

Backing up a bit, though... Do you have any other RewriteRules that work already?

If not write and test a very simple rule like this, for example:


RewriteRule ^test\.html$ http://www.webmasterworld.com/ [R=301,L]

[added] If your code is located in "/error/.htaccess", then that part of the REQUEST_URI will be stripped by Apache, and must not appear in your patterns. If your code were in root, then you look for "^(error/.*)$", but if located in "/error" you look for "^(.*)$". [/added]

Jim

[edited by: jdMorgan at 1:33 pm (utc) on May 4, 2007]