Cross domain 301 redirect is not working with htaccess file

4 replies
  • SEO
  • |
I want to redirect my website to a new domain.
But nothing is happening even after uploading .htaccess file with this code at the root of my old domain.
Please tell me if I am doing something wrong.
Subpages have same urls as mentioned below.

Options +FollowSymLinks
RewriteEngine on
Redirect 301 / http://www.MyNewDomain.com
Redirect 301 /index.php http://www.MyNewDomain.com
Redirect 301 /event.php http://www.MyNewDomain/events.html
Redirect 301 /book_online.php http://www.MyNewDomain/online-booking.html
Redirect 301 /contact.php http://www.MyNewDomain/contact-us.html
#301 #cross #domain #file #htaccess #redirect #working
  • Profile picture of the author paulgl
    I'm only guessing here, but having the first line might be taking over before it gets to the rest.

    The index.php, essentially, is the same as the first line.

    If it did not work, then your server does not have that enabled.

    You can get around this by using php, as your pages use that.

    Just google php redirection. You just put the code on the pages you want to redirect.

    Paul
    Signature

    If you were disappointed in your results today, lower your standards tomorrow.

    {{ DiscussionBoard.errors[10727683].message }}
    • Profile picture of the author imshazia
      Originally Posted by paulgl View Post

      I'm only guessing here, but having the first line might be taking over before it gets to the rest.

      The index.php, essentially, is the same as the first line.

      If it did not work, then your server does not have that enabled.

      You can get around this by using php, as your pages use that.

      Just google php redirection. You just put the code on the pages you want to redirect.

      Paul
      You got it right.
      Just removed this line "Redirect 301 / http://www.MyNewDomain.com"
      Now the code working.
      Thanks!
      {{ DiscussionBoard.errors[10732069].message }}
  • Profile picture of the author yukon
    Banned
    If you have cpanel do the redirect there and it will write/update the htaccess code for you. Fill in the blanks (URLs). Doesn't get any easier than that...
    {{ DiscussionBoard.errors[10727844].message }}

Trending Topics