Support » Fixing WordPress » Fixing redirects in htaccess after domain change

  • websupportguy


    I have recently changed the domain URL on a website and taken away a root level folder, and I am having problems getting the redirects to work correctly.

    The domain to domain redirection works fine – ie, redirects with 301 to But links to deep URLs in the old domain still load the page with the old domain URL, eg try

    If all transforms were working correctly it would redirect to: (as the “/thailand/” folder is no longer used on the site.

    There are two htaccess rules in place which should be transforming this url:

    RewriteCond %{HTTP_HOST} ^bangkoktravelthailand\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.bangkoktravelthailand\.com$
    RewriteRule ^/?$ “http\:\/\/traveltipsthailand\.com” [R=301,L]


    RewriteRule ^thailand/(.*)$$1 [R=301,L]

    The second rewrite rule does work to remove “/thailand/” from URL strings if the domain in the URL is “”, but not if it’s “”. Does that make sense?

    I also tried a variation of the first rewrite rule as:
    RewriteRule ^(.*)$$1 [R=301,L]
    but that didn’t work either.

    Can anyone suggest a rule that will work for me? I’ve run out of ideas and google searches to try.


  • The topic ‘Fixing redirects in htaccess after domain change’ is closed to new replies.