• 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.
    Now the website working fine, but I found an error in wp-admin canonical url on all admin pages:
    Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'blog.example.com/wp-admin/index.php'; cannot be created in a document with origin 'example.com'; and URL 'example.com/blog/wp-admin/index.php';

    When I dig more I found the canonical link is still subdomain( blog.example.com ) :

    <link id="wp-admin-canonical" rel="canonical" href="https://blog.example.com/wp-admin" />
    	<script>
    		if ( window.history.replaceState ) {
    			window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
    		}
    	</script>

    Is there any solution for changing this canonical url from https://blog.example.com to https://www.example.com/blog

    • This topic was modified 8 years, 2 months ago by riyazmuhammad.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘wp-admin-canonical link error’ is closed to new replies.