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. Technical SEO Issues
    4. File name same as folder name, ok?

    File name same as folder name, ok?

    Technical SEO Issues
    4 3 256
    • 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.
    • NeilD
      NeilD last edited by

      Is it ok to have a folder and file name to be both the same

      e.g

      domain.com/xyz-products/

      domain.com/xyz-products.php

      File name would be a page that lists a number of products and then within the folder there would be x-product.php, y-product.php etc

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

        Is the folder itself also a page?  Why not just make domain.com/xyz-products/ serve the domain.com/xyz-products.php page?  That seems like the most intuitive way for it to work.  When people want to get back from a product page within the xyz-products directory to the top level page, they may just edit the URL and delete everything after that (I do this all the time).

        If you want to stick with the structure you listed, it shouldn't have any issues other than what I mentioned above.

        GeorgeAndrews 1 Reply Last reply Reply Quote 1
        • GeorgeAndrews
          GeorgeAndrews last edited by

          There is nothing technically wrong with this, so yes it is OK. I've seen this done before.

          Some people also choose to use an index page at the directory level so that domain.com/xyz-products/ resolves with say "index.php". You would need to make sure you provide the right canonical/redirect combination if you do choose to go this route of course.

          1 Reply Last reply Reply Quote 1
          • GeorgeAndrews
            GeorgeAndrews @john4math last edited by

            Jinx! You owe me a diet coke.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • For a web agency, can the same WHOIS registrant name information between different domain names hurt SEO?
              WhoWuddaThunk
              WhoWuddaThunk
              0
              4
              286

            • Submitting a new sitemap index file. Only one file is getting read. What is the error?
              mm916157
              mm916157
              0
              4
              416

            • Why am I seeing %%name%% showing in the duplicate titles report when it shows the name correctly in the source code?
              SDConvis
              SDConvis
              0
              3
              199

            • URL Folders and Naming Convention Changes?
              Matthew_Edgar
              Matthew_Edgar
              0
              2
              354

            • Converting files from .html to .php or editing .htaccess file
              donford
              donford
              0
              11
              3.6k

            • What are your thoughts on security of placing CMS-related folders in a robots.txt file?
              AlanMosley
              AlanMosley
              0
              4
              431

            • Keywords in file names vs folder names
              RyanKent
              RyanKent
              0
              2
              975

            • URL length - Moving from 6 folder deep to 3 folder deep
              alexhoug
              alexhoug
              0
              4
              979

            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