Viewing 10 replies - 1 through 10 (of 10 total)
  • Hey @jdphoenix,

    Thank you for reaching out.

    It’s odd that both URLs are there and the non-trailing slash version is not redirecting to the one having it. However, they both have the correct canonical (<link rel="canonical" href="https://www.allvalleytransportation.com/limousine-service/" />) so that should make it only index the / version.

    You might want to investigate why your pages are also reachable without a trailing slash, in a default environment, WordPress should redirect it to the / equivalent.

    Thread Starter jdphoenix

    (@jdphoenix)

    hmmm… okay. I have added it with the “/” under the advanced YOAST settings about 5 months ago. Should I leave it blank? or could it be a server setting issue? Thanks!

    Plugin Support Jose Varghese

    (@josevarghese)

    Hi @jdphoenix

    I checked some URLs on your website and noticed that the canonical URL outputted by Yoast SEO contains the trailing slash (/). If you have added the page URL with the trailing slash manually via our metabox, we won’t recommend changing it, as changing it again may take time for Google to update its index.

    Regarding the notice from the website analyzer, we recommend you contact your hosting provider to redirect the non-trailing slash pages to trailing slash URLs.

    Thread Starter jdphoenix

    (@jdphoenix)

    Hi there,

    Thanks so much for your reply. I noticed all of our pages are indexed using the “/” EXCEPT for the homepage.

    Would this code be the proper way to solve the issue using the .htaccess file?

    # Force Trailing Slash
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^[^/]+$ %{REQUEST_URI}/ [L,R=301]

    Also, since the homepage URL does not contain the “/”, will this be an issue forcing a “/” slash on this indexed URL as well?

    Any suggestions would be appreciated. Thanks!

    Plugin Support Maybellyne

    (@maybellyne)

    Unfortunately, I am unable to review your custom code.

    Yoast SEO adds the self-canonical but your homepage canonical shows <link rel="canonical" href="https://www.allvalleytransportation.com/" />.

    It is still best to find out, maybe from your web hosting provider, why WordPress is not redirecting non-trailing slash URLs to the trailing slash equivalent

    Thread Starter jdphoenix

    (@jdphoenix)

    Hi Maybellyne,

    Thank you for your reply. I have reached out to Godaddy and they wanted to charge to do this. I have added this to the .htaccess file…

    # Force trailing slash
    <IfModule mod_rewrite.c>
    	RewriteCond %{REQUEST_URI} /+[^\.]+$ 
    	RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
    </IfModule>

    It appears to work correctly on sub pages, however the homepage URL is not forced to a trailing slash.

    I did notice under the “general settings: within the WordPress admin lists the home and site url without the “/”. Would you recommend I add the slash here? Thanks!

    Current General Settings:
    Site and Home URL: https://www.allvalleytransportation.com

    Plugin Support devnihil

    (@devnihil)

    @jdphoenix No, we do not recommend changing the Site Address (URL) or WordPress Address (URL) setting to include a trailing slash. Furthermore, you can see here that WordPress does not either as they state that:

    Both settings should include the https:// part and should not have a slash “/” at the end.

    Thread Starter jdphoenix

    (@jdphoenix)

    Hi,

    Thanks for your reply. Is it recommended to have a trailing slash on the homepage (allvalleytransportation.com/)??? Does it matter? Currently it does not.

    Also, If you review, Maybellyne’s reply above, she mentioned an issue with redirecting the “non trailing slash” to a “trailing slash”. I contact my hosting company and they said everything is fine. Is there a website you recommended to test for these kinds of errors? Thanks so much for your help on this:)

    Plugin Support devnihil

    (@devnihil)

    @jdphoenix It’s more important that the URL of your homepage be consistent than whether the URL has a trailing slash or doesn’t.

    We checked in the source code of your homepage and do see that the value of the canonical URL points to the version of the URL that contains a trailing slash (see image here:

    <link rel="canonical" href="https://www.allvalleytransportation.com/" />

    Unfortunately we can’t recommend a specific solution to implement that will force the homepage URL to rewrite the URL to contain a trailing slash, but if you search online you can find other users suggestions for code that they implemented to achieve a similar solution. For example, you can find threads related to this topic on Stack Overflow or other sites such as this.

    As for sites to use in order to test for these types of issue, we’d recommend using Google Search Console foremost. You can also find a comprehensive list of other sites we recommend and use for site reviews here: The tools we use for site reviews.

    Thread Starter jdphoenix

    (@jdphoenix)

    Hi Devnihil,

    Thanks for the reply. I reached out on stack overflow and he is our BRIEF conversation:
    https://stackoverflow.com/questions/73379263/forcing-on-homepageindex-page/73379381#73379381

    Good to go now? or no? Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Canonical Issue?’ is closed to new replies.