RewriteEngine On
RewriteRule .? http://www.google.com/?q=%{REQUEST_URI} [L,R=302]
and open up /123 on that domain with some text, see what google’s searching for: not “123”, but “/123” because %{REQUEST_URI} contains the leading slash (I’m fairly certain %{REQUEST_URI} contains the URI specified after GET in the HTTP request, even though no manual confirms this – but then as we both know the Apache manuals tend to be pretty fague).
If you don’t want that leading slash, you’d have to use
RewriteEngine On
RewriteRule ^(.*)$ http://www.google.com/?1=$1 [L,R=302]
I haven’t found a way to make this happen that doesn’t use that dreaded evil .*
Yes. [noparse]http://domain/123[/noparse] What else is 123 supposed to be? It’s certainly not a query string (no ? to denote the use of a query string). Further, you’ve suggested the use of the :kaioken: EVERYTHING :kaioken: atom which is acceptable as you’ve used it (redirecting to another domain) but will be loopy on one’s own website.
mo,
If your variable is merely a series of digits, replace ^.*$ with ^([\d]+)$ or ^([0-9]+)$ (same thing, different way to specify digits. However, I am still wondering what you’re trying to do
David, I’m merely pointing out that %{REQUEST_URI} contains a leading slash (/123), since you seem to be thinking it doesn’t (i.e. you seem to be thinking it just contains “123”).
We’ve had this discussion before …
I know. I’m the one who insists that the / magically appears. However, since 123 is not in a query string, it’s still a far better answer and should be tried before being discarded for something obviously incorrect.