In PHP, output_add_rewrite_var() stores a name/value pair for the URL rewriter and starts the URL-Rewriter output handler if it is not already active.
When that handler flushes, it can add the pair as a query parameter on matching HTML URLs (and as hidden fields in forms) based on url_rewriter.tags and related ini settings. It is separate from ordinary ob_start() buffering, though it uses the output control system.
Syntax
Call output_add_rewrite_var() with the values you need. Start with this line.
PHP
$ok = output_add_rewrite_var('sid', 'abc123');
Call
What it does
output_add_rewrite_var('id', '42')
Stores id=42 for URL rewriting and starts URL-Rewriter if needed.
ob_list_handlers()
Shows "URL-Rewriter" after a successful add.
output_reset_rewrite_vars()
Clears rewrite vars previously added.
Which tags are rewritten depends on url_rewriter.tags (for example a=href). Absolute links to other hosts may be skipped unless the host is allowed. Once the URL-Rewriter handler is turned off, it cannot be started again in the same request.
It saves a name/value pair for URL rewriting and starts the URL-Rewriter output handler if needed so matching HTML links and forms can receive that pair.
Call output_reset_rewrite_vars(). That removes vars added by output_add_rewrite_var().
Host rules and url_rewriter settings decide which absolute URLs are rewritten. Relative URLs are the usual demo case.
It uses output buffering behind the scenes, but it is a dedicated URL-Rewriter handler, not a general-purpose capture buffer you manage like a normal ob_start() call.
No. Once that handler is turned off in a request, it cannot be started again.