Good evening, having to "dismiss" the old gov.it site in favor of the new edu.it, they advised me to set the following .htaccess:

RewriteEngine On 

RewriteCond %{HTTP_HOST} ^www\.oldsite\.gov\.it$ [NC] 
RewriteRule ^ https://www.newsite.edu.it%{REQUEST_URI} [L,R=301] 

RewriteCond %{HTTPS} off 
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

the redirect works from www.vecchiosito.gov.it but does not work for example from www.vecchiosito.gov.it/corsi-di-studio because you are redirected to www.nuovosito.edu.it/corsi-di-studio which is a page that does not exist so rightly error 404.

rightly they advised me to correctly redirect all the pages of the old site to the "correspondents" of the new site, but how is it done?

besides, I should add an exception. the following path www.vecchiosito.gov.it/aulavirtuale/moodle/ must not be redirected to the new site but must be able to be visited.

thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.