Skip to main content

htaccess redirects not working properly



  • kdean
    Your redirect is a little different than what cPanel would generate that works for a wildcard redirect, try: RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ RewriteRule ^(.*)$ http\:\/\/www\.newdomain\.com/$1 [R=301,L]
    I also would recommend putting this code above everything else. Is the old domain parked on top of the new domain, because if it's a separate folder, there's no reason to have any of the old wordpress and other htaccess lines in the file anymore. Just the redirect, and the cPanel generated handlers and directives are fine.
  • Rachel S
    If you want to redirect to a Add the following to your .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^$ [OR] RewriteCond %{HTTP_HOST} ^$ RewriteRule (.*)$

Please sign in to leave a comment.