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

          • laurentjb

            How do I carry out a redirect? Is there a code I need to use?

            redirect redirect chain

            How do I carry out a redirect? Is there a code I need to use? Thank you in advance.

            On-Page Optimization | Oct 1, 2024, 12:15 AM | laurentjb
            0
          • CopBlaster.com

            Will Google Count Links Loaded from JavaScript Files After the Page Loads

            Hi, I have a simple question. If I want to put an image with a link to another site like a banner ad on my page, but do not want it counted by Google. Can I simply load the link and banner using jQuery onload from a separate .js file? The ideal result would be for Google to index a script tag instead of a link.

            On-Page Optimization | Aug 13, 2019, 10:09 PM | CopBlaster.com
            1
          • HashtagHustler

            Url shows up in "Inurl' but not when using time parameters

            Hey everybody, I have been testing the Inurl: feature of Google to try and gauge how long ago Google indexed our page. SO, this brings my question. If we run inurl:https://mysite.com all of our domains show up. If we run inurl:https://mysite.com/specialpage the domain shows up as being indexed If I use the "&as_qdr=y15" string to the URL, https://mysite.com/specialpage does not show up. Does anybody have any experience with this? Also on the same note when I look at how many pages Google has indexed it is about half of the pages we see on our backend/sitemap. Any thoughts would be appreciated. TY!

            On-Page Optimization | Feb 4, 2019, 6:33 AM | HashtagHustler
            1
          • 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
          • jjtech

            How important are image file names

            Hi, How important do you think the image file names are for image search?
            I know it used to be the best practice a while ago but is it still important? Thanks in advance, JJ

            On-Page Optimization | Dec 18, 2013, 4:49 PM | jjtech
            0
          • cschwartzel

            What are "stop" words in Title Tags?

            My client is following his GoDaddy SEO Checklist, and it is reporting 5 errors in Title Tags, saying the Titles contain "stop" words. I can't figure out what these are. Any ideas?

            On-Page Optimization | Dec 15, 2013, 8:43 PM | cschwartzel
            0
          • jmansd

            What does the "base href" meta tag do? For SEO and webdesign?

            I have encounter the "base href" on one of my sites.  The tag is on every page and always points to the home URL.

            On-Page Optimization | May 10, 2011, 3:49 PM | jmansd
            0
          • JedHenning

            Should I include a "|" for better page title SEO results?

            I have seen many sites that include the "|" in page titles and was wondering if there is some SEO value in the practice. Example: Product Name | Company Name Instead of: Product Name by Company Name I have not seen any value in it myself other than a good way to avoid stop words.  I wanted to make sure.  Currently I have the "by" included in the page titles.

            On-Page Optimization | Apr 27, 2011, 7:08 AM | JedHenning
            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.