Difference between "/" at end of URL and without "/"

9,292

Solution 1

Technically speaking http://www.new.com/tag/relationships and http://www.new.com/tag/relationships/ are two different pages just like http://www.example.com/ and http://www.example.com/index.html are two different pages even though they pull up the same page.

To make sure the search engines understand that http://www.new.com/tag/relationships and http://www.new.com/tag/relationships/ are the same page use canonical URLs. This tells the search engines that these pages are the same and which URL to use in their search results. It also makes sure all links to the canonical URL are credited to the main URL.

Solution 2

Google Webmaster Tools Blog has a good article titled To slash or not to slash

Share:
9,292

Related videos on Youtube

Umesh Awasthi
Author by

Umesh Awasthi

Updated on September 18, 2022

Comments

  • Umesh Awasthi
    Umesh Awasthi almost 2 years

    Possible Duplicate:
    Does it make a difference if your url ends in a trailing slash or not?
    Why treat these as different URLs?

    I am doing a 301 redirect in my WP application using .htaccess and have mapped some of the URLs which have either been removed from the new domain or the URL structure has been changed. While doing I got a doubt

    I have following URL structure in my .htaccess file

    RewriteCond %{HTTP_HOST} ^old.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.old.com$
    RewriteRule ^tag/waiting$  http://www.new.com/tag/relationships [R=301,L]
    

    while checking this i found that at some places URL is like http://www.new.com/tag/relationships while at others its like http://www.new.com/tag/relationships/, while both refer to the same location but not sure if this will make any difference to SEO and search engines. Please suggest if the way i am doing mapping is correct or do i need to modify it to handle both UR

  • Umesh Awasthi
    Umesh Awasthi over 12 years
    Thanks for the inputs but i am still not sure how can i do that since they will be redirected by the Apache (.htaccess file) to new URL
  • John Conde
    John Conde over 12 years
    You put the canonical <link> tag in your web page. It doesn't involve htaccess at all.
  • Umesh Awasthi
    Umesh Awasthi over 12 years
    Do you mean i should use one URL say http://www.new.com/tag/relationships in .htaccess file and its version with "/" in the <link> tag on new domain webpage or i need to add this canonical <link> on old domain.being new to this concept its a bit confusing for me
  • John Conde
    John Conde over 12 years
    Keep your htaccess file as it is shown above. Then on http://www.new.com/tag/relationships put the canonical <link> tag for http://www.new.com/tag/relationships/.
  • Umesh Awasthi
    Umesh Awasthi over 12 years
    Thanks John Conde♦ for quick help will need to see how this can be done in WordPress since the pages at WordPress will be generated dynamically.
  • bekay
    bekay over 12 years
    @user702325, install WordPress SEO by Yoast then you can set them for any page as needed.