Articles of rel canonical

add the post as canonical for attachment page wordpress

the attachment page should have canonical added to the main post on attachment page (image.php) I currently have (automatically added by All in One Seo Pack): <link rel=”canonical” href=”https://example.com/main-post/image-name” /> And I want to change it to point to the post (where this image is attached) <link rel=”canonical” href=”https://example.com/main-post” /> You can ignore All in […]

Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445

After changing siteurl ,home url form database it shows 3/4 errors called Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445 Notice: Undefined index: scheme in /var/www/html/wp-includes/canonical.php on line 465 Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 444 Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 444 I have no idea whats wrong with […]

Wrong canonical link on wp-admin pages

I have a subdomain: https://blog.example.com/ I forcibly redirects to directory: https://www.example.com/blog By changing site URL and some RewriteRule on .htaccess. My .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] RewriteCond %{HTTP:X-Forwarded-Host}i ^example\.com RewriteCond %{HTTP_HOST} ^blog\.example\.com$ RewriteRule ^/?(.*)$ https://www.example.com/blog/$1 [L,R=301,NC] RewriteCond %{HTTP:X-Forwarded-Proto} !https […]