0

I have problem with rewrite and I've been working on it for 2 days.

I need to rewrite from domaintest.com/ds to ds.domaintest.com (rewrite, not redirect)

I've tried almost every combination of regular expressions and it still doesn't work. Anyone got an idea?

help witch regular extensions

Dai
  • 141,631
  • 28
  • 261
  • 374
  • URL Rewriters cannot change the hostname that serves a request - only a redirection can do that. The next closest thing is making an reverse-proxy request (with IIS ARR), but that won't change the hostname that appears in the user's address-bar. – Dai Jun 21 '23 at 14:35
  • _"I've tried almost every combination of regular expressions and it still doesn't work. Anyone got an idea?"_ - I'm curious exactly what regular-expressions you used because it simply isn't possible for a `` rule to rewrite the hostname of a request: the `` element only lets you specify a replacement-expression for the request URI's path, [not the request URI's authority](https://stackoverflow.com/questions/2142910/whats-the-difference-between-uri-host-and-uri-authority). – Dai Jun 21 '23 at 14:38
  • Thank you for your response. It explained a lot. – Kamil Lis Jun 21 '23 at 14:40
  • That code, as-is, will rewrite to `https://yourwebsite.tld/https%3A//ds.domaintest.com` - and it doesn't do anything that actually enables ARR. – Dai Jun 21 '23 at 14:53
  • Yes, now it makes sense. Thank you very much. – Kamil Lis Jun 21 '23 at 15:02

0 Answers0