We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 886
    • 39 Posts
    i recently read in a post in http://googlewebmastercentral.blogspot.com (can’t find the specific post right now) that for googlebot "www.example.com" is considered to be a different page than "www.example.com/" (notice the slash at the end of the second example) which means if your incoming links are split to these two pages, you page rank will be split which is obviously bad for SEO.

    The recommended solution is choosing one of those two options as your preferred page and using a 301 redirect to send traffic from the other page to the preferred one..

    I am using Modx with friendly urls enabled and this automatically adds a slash at the end of "Container" resources.

    Using this online tool to check http headers (http://www.webconfs.com/http-header-check.php) i figured that if the slash at the end of a link is missing, Modx redirects to the "correct" page (the one with the slash) using a 302 redirect.
    Problem is that 302 redirects are supposed to be temporary, thus pagerank is not transfered.

    Is there a way to change this so it will use a 301 redirect?
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I’m thinking that’s in the .htaccess file.


      This is what’s in mine:
      RewriteCond %{HTTP_HOST} .
      RewriteCond %{HTTP_HOST} !^(www|evo|dev)\.markhamstra\.nl [NC]
      RewriteRule (.*) http://www.markhamstra.nl/$1 [R=301,L]


      As you can see that puts the www in front and also appends the slash and sends it with a 301 forward. Changing the 301 to 302 would be an option if that’s what you’re using too.


      I’m just thinking now tho. Aint it default behaviour for browsers to visit the site, and append a slash? At least in my firefox I can’t seem to find a website that loads without a slash.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 886
        • 39 Posts
        thnx for replying

        I have similar .htaccess settings
        RewriteCond %{HTTP_HOST} !^www\.athenslindyhop\.com [NC]
        RewriteRule (.*) http://www.athenslindyhop.com/$1 [R=301,L]

        the only difference being you using
        (www|evo|dev)
        instead of 
        www 
        but i think this is a minor thing

        The problem is i get 302 redirects instead of 301 which (301 is what i want, and what is in the .htaccess file after all)

        I’m just thinking now tho. Aint it default behaviour for browsers to visit the site, and append a slash? At least in my firefox I can’t seem to find a website that loads without a slash.

        I thought that myself cause i noticed the same thing, but even if this is the case, googlebot is not a browser and i doubt it would append the slash by default.. As a matter of fact, it definitely doesn’t append it, or else it wouldn’t be mentioned at all in that article in googlewebmasters blog.. (I’ll see if i can find it)

        You can try any website with this tool, http://www.webconfs.com/http-header-check.php to test my site
        www.athenslindyhop.com/el/
        vs
        www.athenslindyhop.com/el
        (the home page seems to default without a slash since it’s not a container)

        and also test
        www.google.com/analytics
        vs
        www.google.com/analytics/
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Quote from: alejaaandro at Dec 26, 2010, 06:56 AM

          thnx for replying

          I have similar .htaccess settings
          RewriteCond %{HTTP_HOST} !^www\.athenslindyhop\.com [NC]
          RewriteRule (.*) http://www.athenslindyhop.com/$1 [R=301,L]

          the only difference being you using
          (www|evo|dev)
          instead of 
          www 
          but i think this is a minor thing

          The (www|evo|dev) has to do with some subdomains I’m running wink
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 886
            • 39 Posts
            found it!
            it wasn’t a post actually, it was a pdf linked in a post, that’s why i had trouble finding it

            take a look at "Subject II: URLs and redirects"
            http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/en//webmasters/docs/google-seo-report-card.pdf

            The (www|evo|dev) has to do with some subdomains I’m running
            yeah, i figured that out, i said that it’s "a minor thing", meaning not having to do with my problem wink
              • 26384
              • 3 Posts
              Quote from: alejaaandro at Dec 28, 2010, 10:50 AM

              found it!
              OK...you found the article you mentioned, which supports your original concerns, but it seems you’re no further along.

              I do think your concern regarding MODx’s use of 302 redirects may be valid, though you might want to look at your own situation in a different way.

              I found this post because I’m having a somewhat similar issue, and after poking around inside MODx’s PHP, I see that MODx only does one type of Header redirect. And as you have noticed, that redirect is a 302 and not a 301. Looking at the PHP function used, it’s obvious there were/are no plans to allow for we end-users to choose the type of redirect used. I see that a very ugly PHP hack is possible which would force all Header redirects to be 301s instead of 302s...however...that’s not a realistic solution, and in your case, I think you have other more important issues.

              Looking at your URLs, your concern is that www.athenslindyhop.com/el and www.athenslindyhop.com/el/ might both wind up in the SERPs, which is bad, because they’re actually the same page. Yes, the standard solution is to 301-redirect one to the other...but before you jump there...you need to first choose one, and then fix all of the links on your own site. Because the main way these problems start in the first place is from links right on your own site...if YOU link to your own site in two different ways, then of course the search engines are going to pick that up!

              Anyway...looking at a "view source" of your home page, www.athenslindyhop.com, I see that you’re linking to the two main pages (an English-language page and a Greek-language page) WITHOUT the trailing slash. That is, your HTML links have href values of "/en-temp" and "/el". And yet, your site’s URLS all have a "hierarchical structure" which indicate the trailing slash is the correct version: athenslindyhop.com/el/contact-us.html, athenslindyhop.com/el/events-parties/big-swing-social-dancing.html , etc.
              Without the trailing slash, there is potential confusion, when trying to decide what no slash COULD mean:
              /el
              /el.php
              /el.html
              /el/
              /el/index.php
              /el/index.html

              On top of that, looking out at some of the SERPs, your decision has already been made for you...the trailing slash is already there, in the results. (google site:athenslindyhop.com).

              I think the reason Google made this choice is because you’ve used the new Canonical link reference, and indicated the trailing slash is preferred:
              <link rel="canonical" href="el/" >

              (sidenote: best practice is to include the full URL. in this case, "http://www.athenslindyhop.com/el/", and not just "el/". See Google Webmaster Central for details.)

              So, I suggest that you put out the fires now (add trailing slashes to your HTML links), and you might not need to worry about 301 and 302 redirects at all. grin
                • 886
                • 39 Posts
                Thnx for the tips..

                Most of my links are automatically generated by modx, so slashes are added when they link to a container, but for some reason i chose to manually set the links in the homepage and i forgot to put the slash.

                I think the reason Google made this choice is because you’ve used the new Canonical link reference, and indicated the trailing slash is preferred:
                I only started using the canonical after reading that article and starting this thread. Google had already chosen the one with the slash. I’ve read though that the canonical is not always respected by search engines, that’s why I also wanted the 301.

                (sidenote: best practice is to include the full URL. in this case, "http://www.athenslindyhop.com/el/", and not just "el/". See Google Webmaster Central for details.)
                thnx, didn’t know this.. I’ll fix it tonight..

                Looking at your URLs, your concern is that www.athenslindyhop.com/el and www.athenslindyhop.com/el/ might both wind up in the SERPs, which is bad, because they’re actually the same page
                Actually that was not my main concern. From what i understood, my pagerank could be split to those pages (ie. instead of having a page with a pagerank of 3, i could end up with two pages with pr of 1 and 2) making it harder to rank higher since they would be competing against themselves.. Not sure if it’s actually the case, but that’s what i figured..

                Anyways, thnx again for the tips.. I fixed some and will get to the rest later..
                  • 9102 ☆ A M B ☆
                  • 318 Posts
                  This is something with which I have a fair amount of experience.

                  In your case, I wouldn’t worry about it too much. It appears that Google has already canonicalized the / version of your URLs. When Google canonicalizes a URL, it combines all link metrics (including PR) for the various versions of the page into the canonical version of the page. If only one version is indexed, the odds are very good that you are just fine and don’t need to do anything.

                  Using the canonical link is also a good solution here. Google respects it pretty strongly (too strongly, really, so that it’s possible to cause serious problems if you misuse it). Since Google already canonicalized the correct version, it’s somewhat overkill but probably a good idea just to verify to Google that it is on the right track.

                  Your internal links should always be consistent. Never link to the same content at different URLs. That applies under pretty much all circumstances, including yours, so it’s a good idea to fix this.

                  Other than that, I would leave well enough alone and not waste too much time on it. It is quite probable that everything is fine.

                  It is a problem that MODx does 302 redirects. That’s just generally a bad practice for SEO -- but fixing it is probably well beyond the scope of this thread.
                    • 9102 ☆ A M B ☆
                    • 318 Posts
                    Oh, yeah -- and definitely use the full URL in your canonical link. I’m surprised that didn’t get your page de-indexed altogether. This is a prime candidate for a "canonical catastrophe" in which the canonical link points to a URL other than the actual URL of the page and Google gets completely confused and decides to de-index the whole thing until you sort it out. It’s happened to me before.
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      As long as you also have the base href, the full url will be generated from that and the relative canonical. I don’t see the problem, then.


                      Just in case someone does decide to want an absolute url, use
                      [[~[[*id]]? &scheme=`abs`]]

                      as the canonical link.
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.