The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. CMS Pages - Multiple URLS (/)

    CMS Pages - Multiple URLS (/)

    Intermediate & Advanced SEO
    9 3 448
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ATP
      ATP last edited by

      Hi guys, this type of question has been asked a few times before but I couldn't find something that told me what i need so apologies if its a tad repetitive.

      I use Magento, and have several pages using its CMS. However, it produces 2 URLS for each page with a simple /.

      For example,

      website.com/hire
      website.com/hire/

      I know google treats this as 2 separate pages, which would be the better solution.

      1. Write a URL re-write for every CMS page
      RewriteRule ^hire$ http://www.website.com/hire/ [R=301,L] (Is this right?)

      2. Write a general rewrite rule to always add the /
      No idea where to begin with this

      3. Add a Canonical tag to the page which i think is possible in magento by adding this to the Custom Design Layout XML option in the page CMS.

      <action method="addLinkRel"></action> <rel>canonical</rel> <href>http://www.website.com/hire/</href>

      This would make the /hire/ page self-reference and the /hire page reference the /hire/ page I think. Which one of these solutions is the best and any pointers with the coding would be grand.

      1 Reply Last reply Reply Quote 0
      • Andy.Drinkwater
        Andy.Drinkwater last edited by

        No need to go with canonicals. A bit of .htaccess code should do it. Pretty sure I got this from Stack Overflow in the past for a client with the same issue:

        <code>RewriteCond%{REQUEST_FILENAME}!-d RewriteRule^(.*)/$ /$1 [L,R=301]</code>
        

        Give that a go and let me know how you get on.

        Edit - Found the page I was looking for here http://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url

        Cheers,

        Andy

        ATP 1 Reply Last reply Reply Quote 1
        • ATP
          ATP @Andy.Drinkwater last edited by

          Thanks Andy, it worked a charm and testing doesn't seem to show any errors elseware.

          I used the 'enfore a trailing slash' version included in the same article you provided which was

          RewriteCond%{REQUEST_FILENAME}!-f
          RewriteRule^(.*[^/])$ /$1/[L,R=301]

          For anybody else thats interested.

          Andy.Drinkwater 1 Reply Last reply Reply Quote 1
          • Andy.Drinkwater
            Andy.Drinkwater @ATP last edited by

            Perfect. Glad to hear it has helped 🙂

            -Andy

            ATP 1 Reply Last reply Reply Quote 0
            • ATP
              ATP @Andy.Drinkwater last edited by

              Hmmm slight hic-cup

              I just noticed the pages ending

              .html

              such as category and product pages are now also being given a /

              Would you advise just swapping and using the remove / rule or is there an edit to this code so it only happens to page that dont end in .html

              Andy.Drinkwater 1 Reply Last reply Reply Quote 0
              • Andy.Drinkwater
                Andy.Drinkwater @ATP last edited by

                Have a try of this:

                <code>RewriteCond %{REQUEST_URI} !\.(html)$</code> 
                

                I think this should work by ignoring anything with .html

                Give it a go but if not, you may need to wait for someone else to come and confirm it 🙂

                -Andy

                ATP 1 Reply Last reply Reply Quote 0
                • ATP
                  ATP @Andy.Drinkwater last edited by

                  Thanks Andy, i will try this on Tuesday after the bank holiday and see if i can get it working. Either way you have provided a workable solution for me so thanks very much!

                  Andy.Drinkwater 1 Reply Last reply Reply Quote 0
                  • Andy.Drinkwater
                    Andy.Drinkwater @ATP last edited by

                    Very welcome and glad it has been of help 🙂

                    -Andy

                    1 Reply Last reply Reply Quote 0
                    • DirkC
                      DirkC last edited by

                      Hi,

                      Far from being an htacess expert, but you could also try this rule:

                      RewriteCond %{REQUEST_URI} /+[^.]+$
                      RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

                      (off course I didn't invent it myself - it's coming from here: https://github.com/phanan/htaccess#force-trailing-slash )

                      I tried it here http://htaccess.madewithlove.be/ - and it seems to work if url is in the form
                      mydomain.com/article => mydomain.com/article/

                      If you check with mydomain.com/article.htm - it's not redirected

                      Could be an alternative if the rule proposed by Andy wouldn't work.

                      Rgds,

                      Dirk

                      1 Reply Last reply Reply Quote 1
                      • 1 / 1
                      • First post
                        Last post
                      • Possible duplicate content issues on same page with urls to multiple tabs?
                        0
                        1
                        43

                      • How does Googlebot evaluate performance/page speed on Isomorphic/Single Page Applications?
                        Martijn_Scheijbeler
                        Martijn_Scheijbeler
                        1
                        2
                        171

                      • Domain.com/old-url to domain.com/new-url
                        Edzjus333
                        Edzjus333
                        0
                        10
                        162

                      • Https://www.mywebsite.com/blog/tag/wolf/ setting tag pages as blog corner stone article?
                        AlirezaHamidian
                        AlirezaHamidian
                        0
                        6
                        135

                      • Should /node/ URLs be 301 redirect to Clean URLs
                        MargaritaS
                        MargaritaS
                        0
                        3
                        172

                      • Multiple URLs for the same page
                        EGOL
                        EGOL
                        0
                        6
                        6.2k

                      • We are changing ?page= dynamic url's to /page/ static urls. Will this hurt the progress we have made with the pages using dynamic addresses?
                        h3counsel
                        h3counsel
                        0
                        3
                        806

                      • WWW vs Non-WWW/Moving a site to a new CMS/Redirect all of the previous URLs
                        KeriMorgret
                        KeriMorgret
                        0
                        5
                        934

                      Get started with Moz Pro!

                      Unlock the power of advanced SEO tools and data-driven insights.

                      Start my free trial
                      Products
                      • Moz Pro
                      • Moz Local
                      • Moz API
                      • Moz Data
                      • STAT
                      • Product Updates
                      Moz Solutions
                      • SMB Solutions
                      • Agency Solutions
                      • Enterprise Solutions
                      • Digital Marketers
                      Free SEO Tools
                      • Domain Authority Checker
                      • Link Explorer
                      • Keyword Explorer
                      • Competitive Research
                      • Brand Authority Checker
                      • Local Citation Checker
                      • MozBar Extension
                      • MozCast
                      Resources
                      • Blog
                      • SEO Learning Center
                      • Help Hub
                      • Beginner's Guide to SEO
                      • How-to Guides
                      • Moz Academy
                      • API Docs
                      About Moz
                      • About
                      • Team
                      • Careers
                      • Contact
                      Why Moz
                      • Case Studies
                      • Testimonials
                      Get Involved
                      • Become an Affiliate
                      • MozCon
                      • Webinars
                      • Practical Marketer Series
                      • MozPod
                      Connect with us

                      Contact the Help team

                      Join our newsletter
                      Moz logo
                      © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                      • Accessibility
                      • Terms of Use
                      • Privacy