Is it possible to rewrite a URL path and insert hostname?

I took a look at the rewrite and uri directive and am not seeing a way to do this.

A friend of mine has a need rewrite the incoming url to put the hostname into the path of the url. I think he also may want to put the value of certain headers in the path as well. Is there anyway to do this?

Not sure what you mean. Do you mean adding a query param with the hostname? If so you could do this, I guess:

rewrite * {path}?{query}&host={host}

If not, please elaborate.

This topic was automatically closed after 30 days. New replies are no longer allowed.