Capturing URL and rewriting it

Question: How would you capture a base url say www.domain.com and rewrite/redirect it to www.domain.com?ref=2 - BUT if the original URL was www.domain.com/somethingelse.html that we would not rewrite it. Of course the router is a routeros device.

The domain part might be done with dns spoofing. And the query part, I’m not sure it can be done with RouterOS. You’ll have to redirect that spoofed ip addr of domain.com to your external web server and do some magic with mod_rewrite, and/or php. Depends on what exactly you need..