title: WordPress 301 redirect loop issue
body: <p>I'm keeping an existing WordPress website but changing the domain name. The old domain name will be redirected to the same website, so if someone went to <a href="https://oldexample.com" rel="nofollow noreferrer">https://oldexample.com</a> they would arrive at <a href="https://newexample.com" rel="nofollow noreferrer">https://newexample.com</a>.</p>
  
  <p>From what I have read will need to do a 301 redirect from the old slugs to the new URLs, like this:</p>
  
  <pre><code>redirect 301 /old-page/ https://newexample.com/new-page
  </code></pre>
  
  <p>But in every article I've read online this approach assumes that the old slug is named something different to the slug.</p>
  
  <p>But in my case, all of the pages have the same slug but will have a different domain. For example: A slug from the old domain might be my-cool-page and with the new domain there is also a page called my-cool-page, and according to what I've read I would need to do this:</p>
  
  <pre><code>redirect 301 /my-cool-page/ https://newexample.com/my-cool-page
  </code></pre>
  
  <p>But, and here is my question: Wouldn't this cause a redirect loop? Or can I simply get away with this:</p>
  
  <pre><code>redirect 301 https://oldexample.com/my-cool-page/ https://newexample.com/my-cool-page
  </code></pre>