-
Hi,
I had the message about the Canonical Tag in RankMath.
I followed the guide and enter the information from this website:
https://www.siteground.com/kb/how_to_redirect_www_urls_to_nonwww/
Into my .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.ilex-luxury.nl [NC]
RewriteRule ^(.*)$ http://ilex-luxury.nl/$1 [L,R=301]
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
The message about the canonical tag was still displayed in rankmatch and the issue didn’t seem to be solved.
After i removed:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.ilex-luxury.nl [NC]
RewriteRule ^(.*)$ http://ilex-luxury.nl/$1 [L,R=301]from the .htaccess file and i created a htaccess (without the .) file with the same information:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.ilex-luxury.nl [NC]
RewriteRule ^(.*)$ http://ilex-luxury.nl/$1 [L,R=301]
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>AND kept the .htaccess file with this code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>The message about the canonical tag disappeared. How is that possible? As normally it shouldn’t run a htaccess file without the . in front of it.
And why does the code not work when i put it in the .htaccess file?
My setup: Synology NAS 423+ and running the website in a container.\
Thanks already for the support
You must be logged in to reply to this ticket.