Forum Moderators: phranque

Message Too Old, No Replies

Accessing query string sent to rewritten URI

Is it my .htaccess or my template

         

calvinmicklefinger

3:59 pm on May 31, 2005 (gmt 0)

10+ Year Member



I have a web page template with the PHP include function that uses variables to fill out section of the page. The pages are named after the file (a single record) that holds the variables.

I use my htaccess to call the template and then use PHP to parse the URI and get the file with the variables for the "page."

In trying to set up PayPal, they are sending back a querystring in what I think is a POST (I'm not a programmer) and I'm supposed to pull some variables from that. I don't seem to be able to and I'm wondering if the .htaccess is helping or hurting.

The following is the full content of my .htaccess ...

# ***************

DirectoryIndex ./Kphp/Kcontent.php

# Start your engines
RewriteEngine on

# Set up the paths to follow
Options +FollowSymlinks -Indexes
RewriteBase /

# Enable access to Site Manager
ReWriteRule ^manager$ manager [L]

# Restrict Access to site resources images, etc.
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite\.com/.*$ [NC]
RewriteRule \.(gif¦jpe?g¦png¦bmp)$ - [F,NC,L]
RewriteRule ^\.htaccess$ - [F]

# Allow Perl Scripts to run
RewriteRule ^cgi-bin/y/d.cgi/?([a-z]+)-IPP([0-9]+)$ - [NC,L]

# Allow Properly formatted URL to access content
RewriteRule ^([a-z0-9]{5})/([a-z0-9]+)/?$ ./Kphp/Kcontent.php [NC,L]

# Allow URL with no Page Name to access main page and assign default AFF_NUM
ReWriteRule ^([a-z0-9]+)/?$ [mysite.com...] [NC,R=301,L]

# ***********

What happens to a querystring with this type of rewrite?

Any help is appreciated.
Thanks.

jdMorgan

4:09 pm on May 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your rules, as shown, pass any query string unchanged.

However, a POST method does not use a query string, it places the data in the content-body of the response. That is, it returns a "page" with the data placed "on the page" as if it were an HTML Web page. It's more secure, and allows for much more data to be passed that using a query string.

Jim

calvinmicklefinger

9:35 pm on May 31, 2005 (gmt 0)

10+ Year Member



As usual, your help is appreciated. Thanks!

Which page would the query string be rendered into in my example .htaccess rules?

Would it be the template Kcontent.php, or the file named "main" which is inserted as a variable into Kcontent?

In other words, where do I put what to catch the variables being sent back in that string?

Again, you help is appreciated.