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.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    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. On-Page Optimization
  4. "translation" of code in htaccess file

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.

"translation" of code in htaccess file

On-Page Optimization
3
4
831
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.
  • momof4
    momof4 last edited by Sep 7, 2014, 11:12 PM

    Hi everyone!

    I am a newbie to the whole SEO and html thing and I am trying to get a better understanding of the "behind the scenes" part of my website. I hope I can find someone here who can translate a piece of code for me that I have in my htaccess file:

    Options -Multiviews
    Options +FollowSymLinks
    rewritecond $1 !^(index.php|public|tmp|robots.txt|template.html|favicon.ico|images|css|uploads)
    rewritecond %{REQUEST_FILENAME} !-f
    rewritecond %{REQUEST_FILENAME} !-d
    rewriterule ^(.*)$ index.php?link=$1 [NC,L,QSA]

    I know that something is getting redirected to the index file, but what (or when) exactly? Does the word "robots"mean that search engine crawlers are getting redirected here? And is this good or bad (in terms of  SEO)? Or is this redirecting people who try to get to my robots/ template or image files??

    Thanks in advance for any answers!

    1 Reply Last reply Reply Quote 0
    • momof4
      momof4 @LynnPatchett last edited by Sep 8, 2014, 9:45 PM Sep 8, 2014, 9:45 PM

      Hi lynnp!

      Thanks for explaining! That was very helpful.

      1 Reply Last reply Reply Quote 0
      • LynnPatchett
        LynnPatchett last edited by Sep 8, 2014, 9:39 PM Sep 8, 2014, 6:04 AM

        It should be redirecting to index.php as long as a number of conditions are met:

        rewritecond $1 !^(index.php|public|tmp|robots.txt|template.html|favicon.ico|images|css|uploads)
        As long as the requested url does not start with one of: index.php, public, tmp, robots.txt, template.html, favicon.ico, imagesloss, uploads and,

        rewritecond %{REQUEST_FILENAME} !-f
        rewritecond %{REQUEST_FILENAME} !-d
        As long as the requested url is not an existing file or directory

        Then:
        rewriterule ^(.*)$ index.php?link=$1 [NC,L,QSA]
        Rewrite the url to index.php?link=REQUESTED-URL (along with any other url variables) and stop processing

        So you should be seeing urls something like index.php?link=page.php or similar if the conditions above are met.
        robots.txt is not being redirected since it is being specifically excluded in the first line.

        Think I got that right, hope it makes sense!

        momof4 1 Reply Last reply Sep 8, 2014, 9:45 PM Reply Quote 1
        • Martijn_Scheijbeler
          Martijn_Scheijbeler last edited by Sep 8, 2014, 4:30 AM Sep 8, 2014, 4:30 AM

          As far as I can tell from checking this snippet it is NOT redirecting traffic to your index.php file and public/tmp/ and a couple of more directories. I'm not that familiar with Apache environments, somehow more Nginx so I can't help you with the other three lines.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 out of 4
          • First post
            1/4
            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

          • imjonny123

            Thoughts on adding "near me" to title tag for local SEO?

            I want to lean out my title tags and will most likely be doing an A/B test. They currently have the "Near Me" modifier in there, which I believe Google can distinguish local SEO without it. Thoughts?

            On-Page Optimization | Sep 26, 2023, 11:12 AM | imjonny123
            0
          • BruceA

            How to 301 redirect, without access to .htaccess and to a new domain

            There are few ways to do this and I would like to ask other Mozzers if they have found the best way. We have a site .co.uk and are moving it back to .com.  However we do not have any access to the site folders for .co.uk.  (We have to move it anyway as our provider is withdrawing their service). We have built our URL 301 redirect file and it is ready to go, but how to impliment it? We can repoint .co.uk to another site, and then redirect all traffic for each URL but this is quite messy, or just forget trying to 301 each page and just rediect the whole site.
            the .com has more authority already, but we ready do not want to frustrate visitors who are using a link to reach a product, only to find they hit our homepage and not the product. Your thoughts would be very welcome or other ideas Bruce

            On-Page Optimization | Jun 24, 2015, 11:08 AM | BruceA
            0
          • TheFlyingSweetPotato

            Image File Names for eCommerce?

            Hi everyone! I'm wondering about naming my product photo file names for an E-Commerce site. Let's say I say have product named Abe Lincoln in the **Print **category for sale with 4 images, relatively similar but from different views for example.Could I name them as follows? 1) abe-lincoln-print.jpg 2) abe-lincoln-print-side-view.jpg 3) abe-lincoln-print-close-up.jpg 4) abe-lincoln-print-font-view.jpg Or is that too many keywords for the page? Should I be worried about keyword stuffing? Plus once I add in title and alt tags and descriptions this could also increase the keyword count for "abe lincoln print"?

            On-Page Optimization | Mar 22, 2015, 7:20 PM | TheFlyingSweetPotato
            0
          • inlinear

            Duplicate Content when Using "visibility classes" in responsive design layouts? - a SEO-Problem?

            I have text in the right column of my responsive layout which will show up below the the principal content on small devices. To do this I use visibility classes for DIVs. So I have a DIV with with a unique style text that is visible only on large screen sizes. I copied the same text into another div which shows only up only on small devices while the other div will be hidden in this moment. Technically I have the same text twice on my page. So this might be duplicate content detected as SPAM? I'm concerned because hidden text on page via expand-collapsable textblocks will be read by bots and in my case they will detect it twice?Does anybody have experiences on this issue?bestHolger

            On-Page Optimization | Jun 29, 2013, 12:06 AM | inlinear
            0
          • lbohen

            Does Commented HTML Code Get Spidered?

            I have a change, perhaps temporary, to my web store that I will be making. I am wondering if the code that I will comment out () gets spidered?

            On-Page Optimization | Feb 1, 2013, 12:11 AM | lbohen
            0
          • MitchellStoker

            Does having a "+" in a URL hurt SEO? Would much value be gained changing it to a hyphen?

            There's a site that contains "+" signs in the URL in order to call different information for the content on the page.  Would it be better to change those to hyphens (-), or not that much value will be gained, so leave them as is? Thanks!

            On-Page Optimization | Oct 20, 2011, 5:31 PM | MitchellStoker
            0
          • PeterMurray

            Does Code Order Matter?

            I read/was told that it was a good idea to order your HTML to show the most important content first. So, on many sites I had put my global navigation div, for instance, below my main content div. Does this still apply? And does wise use of HTML 5 mean this is no longer necessary (eg use of "nav" section tag to indicate this section is about navigation). In the same vein, how does Google know that my sidebar nav is my sidebar nav (which your site seems to say is probably given less weight than top nav), and how does it know my topnav is my top nav? Maybe a daft question, but when someone asked me yesterday I realised I didn't know! (Phew - at last I have asked a short question!).

            On-Page Optimization | Apr 14, 2011, 6:58 AM | PeterMurray
            0
          • BigBlaze205

            Image file name, is it important

            If I use the same image all over my site, do I need to change the file name to avoid duplicate? Different alt text will be use on those images

            On-Page Optimization | Apr 15, 2011, 5:47 PM | BigBlaze205
            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

          Access all your tools in one place. Whether you're tracking progress or analyzing data, everything you need is at your fingertips.

          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.