# HTTP Response rewrite

**URL:** <https://community.f5.com/t/http-response-rewrite/47901>\
**Category:** Technical Forums\
**Created:** [May 22, 2020, 8:11pm UTC](https://community.f5.com/t/http-response-rewrite/47901 "2020-05-22T20:11:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ottleydamian](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@ottleydamian](https://community.f5.com/u/ottleydamian)\
**Post date:** [May 22, 2020, 8:11pm UTC](https://community.f5.com/t/http-response-rewrite/47901/1 "2020-05-22T20:11:55Z")

</div>

I trying to modify text in the data portion of a packet but I’m not having success. The content-type does state text as one of the types, I have the default stream profile attached to the VIP. So I’m not sure if my code is incorrect or the F5 cannot read the response. I’m trying to change [mywebsite.plate.com](http://mywebsite.plate.com) to [abclabs.facts.net](http://abclabs.facts.net)

If I should use something other than a stream profile tell me.

Client Request:

- POST /xi/ajax/whatever… HTTP/1.1

Server Response:

- HTTP/1.1 200 OK
- Content-Type: text/javascript;charset=UTF-8
- Strict-Transport-Security: max-age=16070400
- Cache-Control: no-store,no-cache
- Connection: keep-alive
- Transfer-Encoding: chunked
- dwr.engine.\_remoteHandleCallback(‘0’,‘0’,{baseUrl:“[https://mywebsite.plate.com](https://mywebsite.plate.com)”,msg:null,proxyFullName:null,success:true,url:“[https://mywebsite.plate.com/learning/user/deeplink\_redirect.jsp?linkId=HOME\_PAGE&fromSF=Y](https://mywebsite.plate.com/learning/user/deeplink_redirect.jsp?linkId=HOME_PAGE&fromSF=Y)”});

My code:

```tcl
when HTTP_RESPONSE {
  # Check if response type is text
  if {[HTTP::header value Content-Type] contains "text"}{
  
    # Replace mywebsite.plate.com with abclabs.facts.net
    STREAM::expression "mywebsite.plate.com@abclabs.facts.net@"
 
 
    # Enable the stream filter for this response only
    STREAM::enable
    
	}
}

```

---

<div class="post-metadata">

**Author:** ![ottleydamian](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@ottleydamian](https://community.f5.com/u/ottleydamian)\
**Post date:** [May 22, 2020, 8:42pm UTC](https://community.f5.com/t/http-response-rewrite/47901/2 "2020-05-22T20:42:27Z")

</div>

Solved: the example I looked at was wrong, the syntax is

STREAM::expression {@corning03.plateau.com@kdlabs.corningtest.net@}
