"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
-
"Avoid Multiple Page Title Elements"
Hi, in page recommondation I get a "Acoid Multiple Page Tile Elements" Fix. Make sure your page has only one <title>tag. </span><em>"Web pages are meant to have a single title, and for both accessibility and search engine optimization reasons, we strongly recommend following this practice"</em></p> <p>Well I'm trying....I am not able to find where og why I have multiple titles in this page?</p> <p>This is a norwegian page, but maybe someone can look through it?</p> <p>http://www.proplantime.no/bransjer/bygganlegg/mannskapsliste</p></title>
On-Page Optimization | | Marked_Proplan0 -
Code Quality checker tool?
Hi All, I have seen one tool - http://nibbler.silktide.com/ which give code quality score and if we go for pro version it's name is sitebeam - http://nibbler.silktide.com/en_US/pro Can anyone share experience of this tool? Also any other tool you can suggest to check code quality of ecommerce site? Pls don't suggest manual checking. Thanks!
On-Page Optimization | | pragnesh96390 -
.htaccess Question and Ranking
I have some basic rules set up in my .htaccess file and just curious as to the implications of them as I seem to have a website ranking very low on Search indexes for no particular reason that I can fathom. My question is a follows I have a htaccess rules set up in my application application that first strips the file suffix and then adds a closing brace for example Rule 1: http://www.domain.com/my_page.php becomes http://www.domain.com/my_page
On-Page Optimization | | ecrmeuro
Rule 2: http://www.domain.com/my_page becomes http://www.domain.com/my_page/ Will this rule expecially Rule 2 effect ranking or will these rule have no adverse affect on the website as my MOZ reports still seem to have pages listed win the Top Pages by PA section without the www? Below is an example of the htacess file. RewriteEngine On Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} /+[^.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L] Redirect non-WWW to WWW... RewriteCond %{HTTP_HOST} ^contractor-accounts.co.uk [NC]
RewriteRule ^(.*)$ http://www.contractor-accounts.co.uk/$1 [L,R=301] Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]0 -
I have an eCommerce Site with in some cases, 100s of versions of the same product. How do I avoid "duplicate content" without writing literally 100s of unique product descriptions for the exact same product?
For instance, one item where the only difference is the Sports Team Logo is different, etc... or It comes in a variety of color Variants. I'm using Shopify.
On-Page Optimization | | pstone291 -
Is there a tool that will "grade" content?
Does anybody know of a tool that can "grade" content for Panda compliance. For example, it might look at: • the total number of words on the page • the average number of words in sentences • grammar • spelling • repetitious words and/or phrases • Readability—using algorithms such as: Flesch Kincaid Reading Ease Flesch Kincaid Grade Level Gunning Fog Score Coleman Liau Index Automated Readability Index (ARI) For the last 5 months I've been writing and rewriting literally 100s of catalog descriptions—adhering to the "no duplicate content" and "adding value" rubrics—but in an extremely informal style. I would like to know if I'm at least meeting Google Panda's minimum standards.
On-Page Optimization | | RScime250 -
How do you create a 301 redirect for www.mysite..com/index.html in htaccess.
I understand that it is possible to create a 301 redirect for www.mysite..com/index.html to www.mysite.com. (as well as subdirectories.) How is this accomplished? My hosting company says that setting this up in htaccess will cause "Apache to geti into an infinite loop and the page won’t load." I have read on the forum that this is possible. Any help would be greatly appreaciated. THanks. Perri
On-Page Optimization | | PerriCline0