Skip to main content

htaccess redirects not working properly

Comments

2 comments

  • 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.
    0
  • Rachel S
    If you want to redirect olddomain.com to a newdomain.com Add the following to your .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.olddomain.com$ RewriteRule (.*)$
    0

Please sign in to leave a comment.