title: .htaccess non-www to www causing 404 link error
body: <p>I changed my website from example.com to www.example.com in the .htaccess using this 301 redirect code below. </p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  </code></pre>
  
  <p>The homepage works fine now and redirects properly to the www version instead of the non www version of my site which is what I wanted. But now the links on my site do not work at all and I'm getting a 404 doesn't exist page. I'm using Wordpress. How can I fix this? </p>
  
  <p>Edit: Never mind, I fixed it. I realized I accidentally deleted the part that was needed for WordPress to work properly and put in the www code in its place. Thank you.</p>