skip to Main Content

I am trying to move my whole website through .htaccess doing this

 #Options +FollowSymLinks
 RewriteEngine on
 RewriteRule ^(.*)$ https://newdomain/$1 [R=301,L]

Some of the links from the old website are not exactly the same of the new website, so I should manually edit this rule to make an exception from olddomain/link to newdomain/new-link

I tried the rules but it didn’t work.
Thanks in advance for your help.

2

Answers


  1. Chosen as BEST ANSWER

    I solved like this

        #Options +FollowSymLinks
    RewriteEngine on
    Redirect 301 /old/link/ https://newdomain/new-link
    RewriteRule ^(.*)$ https://newdomain/$1 [R=301,L]
    

    Thanks.

    Ciao.


  2. Be sure your custom rules are written before your global redirection and are tagged Last [R=301,L]

    exemple :

     Rewrite oldURI https://newdomain/newCustomURI [R=301,L]
    

    Also, try in a fresh (private ? or new ) browser window : in some browsers , http redirection are cached

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search