1
votes

I need to change website domain from www.domain.com to www.newdomain.com/en but I also need to specify some pages from old website to new website like www.domain.com/page to www.newdomain.com/en/subfolder/subfolder/page.

Last thing should be great keeping one subfolder path of old website free of redirect like www.domain.com/admin in order to keep backend access to old website.

What would you suggest me to add to old site htaccess file in order to achieve that with a sort of fallback mechanism for specifc pages and whole domain to subdirectory?

Thank you

1

1 Answers

0
votes

You can add the following 301 redirect to your oldsite/htaccess :

Redirect 301 / http://newdomain.com/en/subfolder/subfolder/

This will redirect all requests from your old site to the subfolder in your new site

Edit : as per your comment, to exclude a specific path from the redirection, you may use RedirectMatch

    RedirectMatch 301 ^/((?!page1|page2).*) http://newdomain.com/en/subfolder/subfolder/$1

This will not redirect /page1 or /page2 .