title: .htaccess edit middle of URL
body: <p>I'm trying to change a specific section of a URL, rewriting the request via .htaccess commands. I just want to change one specific part of it, but the value of that part can vary. The initial URL would be something like:</p>
  
  <p><a href="http://www.domain.website.com/hello/search" rel="nofollow noreferrer">http://www.domain.website.com/hello/search</a></p>
  
  <p>Given this, how would I replace hello, knowing it won't always be hello. I've been using htacces.madewithlove.be in order to test my solutions but I've only found things that can append to the end of replace the entire thing</p>
  
  <p>I should also clarify that this is specifically going to have to be in the <code>RewriteCond RewriteRule</code> format. So an expression that would replace the whole thing would be like the following: </p>
  
  <pre><code>RewriteCond %(HTTP_HOST) ^example(A-Za-z0-9\.]*)\.com [NC]
  RewriteRule ^(.*)$ http://www.new-website.com/$1 
  </code></pre>
  
  <p>and the result would be <a href="http://www.new-website.com/" rel="nofollow noreferrer">http://www.new-website.com/</a></p>