Search code examples
.htaccesshyperlinkurl-rewritingtrailing-slash

.htaccess rewrite rule for trailing slash after .com for backlinks


Backlinks, so links from other pages to my wordpress page, are missing a slash after the .com part. So https://mypage.com/subpage results in https://mypage.comsubpage

This happened after I've changed the domain of a page from .de to .com Everything else seems to work fine, only those external backlinks to my page are missing the slash.

Tried all different rewrite rules but none worked or even got me a 404.

This is my code:

# BEGIN rlrssslReallySimpleSSL rsssl_version[3.2.5]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL

# 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>
# END WordPress

https://mypage.comsubpage should result in https://mypage.com/subpage for links from other pages/backlinks. Thanks!


Solution

  • Everything ok with the rewrite rules. Obviously the mistake was in my cache of my browser (Chrome). Firefox and Safari worked ok (only found that out after I posted this question, sorry). After I deleted the cache Chrome went ok and added the slash.

    Thanks anyways Xandru