"translation" of code in htaccess file
-
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!
-
Hi lynnp!
Thanks for explaining! That was very helpful.
-
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 directoryThen:
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 processingSo 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!
-
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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
Tracking down rel="canonical" on Wordpress site
A rel="canonical" is being added to every page and post on my Wordpress site - not tag results, not category results. Not a major problem, right? Except that I don't know where it's coming from. I've tried tracking it down - change the theme back to a default one, turn off all the plugins - it's still there. Is it coming from .htaccess perhaps? The only issue it is causing is that it has causes me to have to turn off the canonical option in Platinum SEO as that was resulting in two identical rel=canon on each page. It doesn't seem to be causing problem but I'd like to get a better understanding of what it going on.
On-Page Optimization | | robandsarahgillespie0 -
What is the Best Way to Translate a Website?
What is the best way? Using a different domain Using a subdomain of the main site Using a folder of the main site What's your take?
On-Page Optimization | | sbrault740 -
Google is showing the "wrong" page in the serps for user queries
Our site, cpuboss.com has two main types of pages: comparisons of CPUs, and pages about individual CPUs. When I google search for "fx8350", a keyword for the cpu "AMD FX-8350", I hoped to see our CPU page ranking, instead I see a comparison of this CPU against another. http://i.imgur.com/QwNczDj.png?1 (Our page ranks #5) Any idea? Many of our comparisons rank for CPU keywords, when I think it'd be a better experience for the user if our cpu pages ranked instead. This particular CPU page is linked to on our homepage with appropriate anchor text, and linked to on that comparison also. I would have hoped the relevance of the cpu page to this keyword would be stronger than the comparison page, and google might use that relevance signal to show the user the right page. thoughts?
On-Page Optimization | | cdnventure0 -
When You Add a Robots.txt file to a website to block certain URLs, do they disappear from Google's index?
I have seen several websites recently that have have far too many webpages indexed by Google, because for each blog post they publish, Google might index the following: www.mywebsite.com/blog/title-of-post www.mywebsite.com/blog/tag/tag1 www.mywebsite.com/blog/tag/tag2 www.mywebsite.com/blog/category/categoryA etc My question is: if you add a robots.txt file that tells Google NOT to index pages in the "tag" and "category" folder, does that mean that the previously indexed pages will eventually disappear from Google's index? Or does it just mean that newly created pages won't get added to the index? Or does it mean nothing at all? thanks for any insight!
On-Page Optimization | | williammarlow0 -
Your opinion on "Keyword | Keyword 2 | Keyword 3 - Sitename" Meta Title
While I'm personally against It I have seen it used. I would think that Google might see this as some degree of keyword stuffing, rather than a 'natural' title, which may hinder ranking. What are your thoughts?
On-Page Optimization | | azu250 -
Robots file include sitemap
Hello, I see that google, facebook and moz... have robots.txt include sitemap at the footer.
On-Page Optimization | | JohnHuynh
Eg: http://www.google.com.vn/robots.txt Sitemap: http://www.google.com/sitemaps_webmasters.xml
Sitemap: http://www.google.com/ventures/sitemap_ventures.xml Should I include my sitemap file (sitemap.xml) at the footer of robots.txt and why should do this? Thanks,0 -
Developer comments in code & SEO
A client of mine has provided an SEO report that states:- "The inclusion of comments by developers in the coe is common practice..... ....its is not positive to leave large blocks of code in the site as makes crawling difficult to crawl" Im thinking that this has no SEO import at all, any one come across this? Thanks z z1eEy
On-Page Optimization | | zabba0 -
Image Optimization - File Name Important?
I am currently working on a site with 100+ recipes that all have image file names that are relevant, but not optimized for keyword purposes. I'm wondering - from an SEO perspective - would it be worth my time to go back through all of the images and rename them with keywords in mind? On my own site I have always done this as a "best practice" but I'm curious - does it make a difference to search engines? Does anyone have any recent research/experiences that they would like to share? Thanks!
On-Page Optimization | | EssEEmily0