mardi 29 octobre 2019

Domain change: redirect 301 with htaccess does not work

I transferred my website from olddomain.de to newdomain.de and wanted to redirect every page of the old website to the new website (e.g. olddomain.de/contact -> newdomain.de/contact). When I enter the main page of the old website in the browser, I am getting redirected correctly but all other pages are not redirected.

I tried a lot of different redirect options and currently this one is implemented (the first IfModule already existed):

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.de/$1 [R=301,L]
</IfModule>

# END WordPress

Does anyone know how to correct the htaccess file, so that all pages of the website are being redirected?




Aucun commentaire:

Enregistrer un commentaire