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. .htaccess file in wordpress blog

    .htaccess file in wordpress blog

    Technical SEO Issues
    5 2 449
    • 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.
    • seoug_2005
      seoug_2005 last edited by

      I want to redirect non www to www in blog hosted by wordpress. Where can i find .htaccess file ? Shall i have to create a new one ? If yes, where should i upload it ?

      Thanks

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

        There isn't one by default. You can create one by uploading it to the root of your directory. So where the wp-config.php file and the rest is located.

        seoug_2005 1 Reply Last reply Reply Quote 1
        • seoug_2005
          seoug_2005 @YannickVeys last edited by

          Thanks Yannick.

          How do i upload the file to root folder. Where can i find wp-config.php file.  A few step by step explanation will be of much help.

          YannickVeys seoug_2005 2 Replies Last reply Reply Quote -1
          • YannickVeys
            YannickVeys @seoug_2005 last edited by

            🙂 These are really Wordpress basics Atul 🙂

            Might be a good idea for you to read some articles on wordpress.org about this.

            You can find the wp-config.php file in the root folder of your domain. Where all the wordpress files are located and where all the folders are located like /themes /plugins. That's the root.

            Making a .htaccess file isn't hard. It's just a txtfile which has been saved as a .htaccess file without an extension.

            Just add the following code, where example.com is your domain

            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^example.com
            RewriteRule (.*) http://www.example.com/$1 [R=301,L]

            1 Reply Last reply Reply Quote 2
            • seoug_2005
              seoug_2005 @seoug_2005 last edited by

              I know these are basics of wordpress. Now, i need to read some articles to enlighten me.

              I appreciate your help. Thanks.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Set Up htaccess File
                GFD_Chris
                GFD_Chris
                0
                2
                48

              • How to optimize Wordpress.org hosted blogs
                ThompsonPaul
                ThompsonPaul
                0
                4
                50

              • Should publish as page or blog posts on Wordpress ?
                evolvingSEO
                evolvingSEO
                0
                5
                124

              • How should I properly setup my .htaccess file?
                maxduveen
                maxduveen
                0
                5
                2.0k

              • Htaccess file
                DMGoo
                DMGoo
                0
                5
                437

              • Htaccess help... I moved my blog from a seperate domain to newdomain.com/blog
                KristyO
                KristyO
                0
                7
                509

              • WordPress blog and XML sitemap
                hawkvt1
                hawkvt1
                0
                7
                497

              • What should be noindexed on a Wordpress blog?
                MauroMazzocchini
                MauroMazzocchini
                0
                10
                1.4k

              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