Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Posting variables to Mod ReWrite

... without actually going to another page?

4:48 pm on Sep 23, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:June 16, 2003
votes: 0

Would it be possible to post variables to a URL without actually having the visitor go through that page?

For example :

The ReWrite Rule

RewriteEngine on
RewriteRule (.*)\.html search.php?var1=$1 [L]

Would it be possible to send the variables (along with HTTP_REFERER, REMOTE_ADDR, etc) to another URL (such as tracking.php) for tracking, without forcing the visitor to see it?


1:32 pm on Sept 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0


No and yes. You *do* have to "go there" to the script or html page, but you don't have to display the new URL to the user.

mod_rewrite can't "call" a script per-se; it is an in-line function in the server file lookup process for purposes of this discussion, so once it exits, it exits.

I'd suggest you call a script to do your counter function, and then have that script load a page or whatever you want to do afterward. You can use mod_rewrite to change the request for any page on your site into a request for the script, and then pass the originally-requested page to that script as a query string. After the script completes its function, it can then look at the query string and load the requested page for the user.

The above is still a bit general because I'm not sure I completely understood your question.