undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Technical SEO
  4. .htacess file format for Apache Server

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

.htacess file format for Apache Server

Technical SEO
3
5
1.9k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • karthik-175544
    karthik-175544 Subscriber last edited by Mar 23, 2011, 2:56 AM

    Hi,

    My website having canonical issue for home page, I have written the .htaccess file and upload the root directory. But still I didn't see any changes in the home page. I am copying syntax which one I have written in the .htaccess file. Please review the syntax and let me know the changes.

    Options +FollowSymlinks RewriteEngine on #RewriteBase /

    re-direct index.htm to root / ### RewriteCond %{THE_REQUEST} ^./index.htm\ HTTP/ RewriteRule ^(.)index.htm$ /$1 [R=301,L]

    re-direct IP address to www ### re-direct non-www to www ### re-direct any parked domain to www of main domain RewriteCond %{http_host} !^www.metricstream.com$ [nc] RewriteRule ^(.*)$ http://www.metricstream.com/$1 [r=301,nc,L]

    Is there any specific htaccess file format for apache server?

    Thanks,

    Karthik

    1 Reply Last reply Reply Quote 0
    • KeriMorgret
      KeriMorgret @karthik-175544 last edited by Sep 5, 2011, 1:59 AM Sep 5, 2011, 1:59 AM

      Hi Karthik,

      I'd recommend posting a new Q&A question about this, as this is now a few months old and a bit buried. You might hold off until Tuesday US time, since we have a holiday tomorrow and there won't be nearly as many people online.

      When you do write your question, it would be helpful to add to your post what types of errors you get when you try to implement this -- just what you have tried, and what the results are.

      I also see that your site doesn't redirect non-www to www. If you want to fix that too, now would be a good time to ask about it.

      Keri

      1 Reply Last reply Reply Quote 0
      • karthik-175544
        karthik-175544 Subscriber @KeriMorgret last edited by Sep 5, 2011, 1:51 AM Sep 5, 2011, 1:51 AM

        Hi Keri,

        Thanks for your message. I didn't find solution for the redirection. It would be great if you help me to fix that issue. How we can do the SEO friendly redirection (301) in tomcat server?

        Karthik

        KeriMorgret 1 Reply Last reply Sep 5, 2011, 1:59 AM Reply Quote 0
        • KeriMorgret
          KeriMorgret last edited by Aug 30, 2011, 6:12 PM Aug 30, 2011, 6:12 PM

          Hi! I'm following up on older Q&A questions. Did any of the resources from the earlier post help you out, or is there anything we can do to help you get this redirect implemented?

          karthik-175544 1 Reply Last reply Sep 5, 2011, 1:51 AM Reply Quote 0
          • topic:timeago_earlier,5 months
          • oneticsoft
            oneticsoft last edited by Mar 23, 2011, 5:07 AM Mar 23, 2011, 5:06 AM

            Hi, there is something: http://httpd.apache.org/docs/1.3/howto/htaccess.html, A tutorial: http://www.freewebmasterhelp.com/tutorials/htaccess/1

            And some examples here:

            http://knowledge.freshpromo.ca/seo-tools/301-redirect.php

            http://www.seo-consultant-services.co.uk/301-redirects-www-non-www-canonical-problems.html

            http://www.dailyblogtips.com/how-to-setup-a-301-redirect/

            http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm

            First example best describes what you need, cannonical redirect

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 out of 5
            • First post
              1/5
              Last post

            Got a burning SEO question?

            Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


            Start my free trial


            Browse Questions

            Explore more categories

            • Moz Tools

              Chat with the community about the Moz tools.

            • SEO Tactics

              Discuss the SEO process with fellow marketers

            • Community

              Discuss industry events, jobs, and news!

            • Digital Marketing

              Chat about tactics outside of SEO

            • Research & Trends

              Dive into research and trends in the search industry.

            • Support

              Connect on product support and feature requests.

            • See all categories

            Related Questions

            • Damian_Ed 0

              Unsolved Temporary redirect from 302 to 301 for PNG File?

              302 temporary riderect 301 http status image issue

              #302HTTP #temporaryredirect
              Hi everyone, Recently I have faced a crawl issue with my media images on website. For example this page url https://intreface.com/wp-content/uploads/2022/12/Horion-screen-side-2.png has 302 HTTP Status and the recommendation is to change it 301. I have read the article on temporary redirections here:
              https://moz.com/learn/seo/redirection?_ga=2.45324708.1293586627.1702571936-916254120.1702571936
              but its not written here how to redirect in my HTML 1 image url not the landing page.
              Screenshot 2023-12-15 at 11.02.40.png
              I have messaged to MOZ Support but they recommended to go for the MOZ Community!
              Screenshot 2023-12-15 at 11.06.02.png Could you assist me wit this issue please? I can reach HTTML of the necessary page and change what I need for permanent redirection but firstly I need to understand how to do that correctly.

              Technical SEO | Jan 23, 2024, 5:26 AM | Damian_Ed 0
              0
            • KaraParlin

              Does having a sub-domain on a different server affect SEO?

              I'm working with a company that has a hard-coded website on the root domain, and then a WordPress blog on a subdomain on a separate server. We're planning on implementing a hub and spoke model for their content, hosting the main hubs on the root domain and the linked articles on the blog. Is having the blog on a different server going to hinder our SEO efforts?

              Technical SEO | Oct 31, 2020, 12:12 AM | KaraParlin
              0
            • Keith-007

              Using GeoDNS across 3 server locations

              Hi, I have multiple servers across UK and USA. I have a web site that serves both areas and was looking at cloning my sites and using GeoDNS to route visitors to the closest server to improve speed and experience So UK visitors would connect to UK dedicated server, North America - New York server and so on Is this a good way or would this effect SEO negatively. Cheers Keith

              Technical SEO | Jul 1, 2020, 11:38 AM | Keith-007
              1
            • ufmedia

              Recommended log file analysis software for OS X?

              Due to some questions over direct traffic and Googlebot behavior, I want to do some log file analysis.  The catch is this is a Mac shop, so all our systems are on OS X.  I have Windows 8 running in an emulator, but for the sake of simplicity I'd rather run all my software in OS X. This post by Tim Resnik recommended Web Log Explorer, but it's for Windows only.  I did discover Sawmill, which claims to run on any platform. Any other suggestions?  Bear in mind our site is load balanced over three servers, so please take that into consideration.

              Technical SEO | Jun 11, 2015, 11:55 AM | ufmedia
              0
            • IceIcebaby

              Is it important to include image files in your sitemap?

              I run an ecommerce business that has over 4000 product pages which, as you can imagine, branches off into thousands of image files. Is it necessary to include those in my sitemap for faster indexing? Thanks for you help! -Reed

              Technical SEO | Mar 31, 2014, 11:07 AM | IceIcebaby
              0
            • Justin1

              Redirection plugin: wordpress vs apache module?

              Hi, Any one familiar with the wordpress plugin 'redirection' Are there any SEO benefits of having the plugin write the 301 redirects into the .htaccess? The standard mode does not use .htaccess but has wordpress genertae the 301s Thanks

              Technical SEO | Dec 20, 2012, 4:29 PM | Justin1
              0
            • neooptic

              How to extract URLs from a site (without bringing the server down!)

              Hi everybody. One of my clients is migrating to a new ecommerce platform, and we need to get a list of urls from the existing site to start mapping out the 301 redirects. Usually, I'd use a tool like Xenu or Integrity to crawl and output a list. However, the database and server setup is so bad that it can't handle the requests from these tools and it sends the site down. This, unsurprisingly, is one of the reasons for the migration. Does anybody know of a way to get a full list of urls without having to make a bunch of http requests which will kill the site? Any advice would be much appreciated!

              Technical SEO | Nov 14, 2011, 7:03 PM | neooptic
              0
            • nicole.healthline

              Does Google index XML files?

              Does Google or other search engines include XML files in their index? More specifically, I am wondering how Google knows the difference between an xml filetype and an RSS feed.

              Technical SEO | Jul 7, 2011, 1:40 PM | nicole.healthline
              0

            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
            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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy

            Looks like your connection to Moz was lost, please wait while we try to reconnect.