I'm trying to redirect individual URLs on http://olddomain.tld
(retired WordPress site) to individual URLs on https://newdomain.tld
(new WordPress site) using .htaccess
.
Redirecting the home page works fine with Redirect 301 / https://newdomain.tld
(so I know I didn't forget to turn on Rewrite engine, or anything like that).
None of the other redirects works correctly, however. Example: I write Redirect 301 /page/ https://newdomain.tld/page/
in .htaccess
, and then http://olddomain.tld/page/
redirects to https://newdomain.tldpage
. That is, the redirect is present, but it drops the trailing slash in every case.
What could be causing this?
I tried all kinds of increasingly exotic variations of the olddomain.tld
.htaccess
, before finally getting the idea to see if trailing slashes are somehow getting dropped by newdomain.tld
's .htaccess
. Could something in here be doing it?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
https://newdomain.tldpage
" - presumably that's just a typo, there is a slash after the domain name?.htaccess
fromolddomain.tld
.