"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
-
Do you need to include the top menu on every single page of the site in the code?
When using cache: on google, and clicking on Text-only version, our site has the top menu gibberish on top? My feeling is that this take away SEO juice from our title and focus keyword. Our website is culinarydepotinc.com
On-Page Optimization | | Sammyh1 -
"?inline=true" Duplicate Page
I have a new Drupal client and am getting a duplicate page error and indicates "?inline=true" after the domain as the culprit. Google comes up empty 😞
On-Page Optimization | | JimCoarse0 -
Rel="canonical" at the same page
Hello Everyone!! We have a Joomla Site and in the template we have a php function that create the **link rel="canonical" **and in the href inserts the same page url. For example, if the we do a search and the url have some cookies. That Url is gonna be the **rel="canonical" **for that page. Is it working correctly? We need an advice to to set it up correctly! Thanks!
On-Page Optimization | | mycostaricalink0 -
Our urls for adwords are slightly different from current urls presented on site (weused htaccess to help create shorter urls). How important is it that the adwords url match the sitemap url for keywords on those pages?
Hello, We have dynamic urls that we have made into short urls through htaccess and code manipulation. Some of our adwords urls are different from our page urls - for example a) Latest version of page www.abc.com/x-y-z.html b) Previous version of url www.abc.com/x+y+z.html c) raw original version www.abc.com/yyy/zzz?category=X&Product-code=Y etc etc. Would my ranking for keywords on the page improve if I diligently made all of them the same? They all go to the same page even now, and no 404 errors or anything. Thanks Sam
On-Page Optimization | | samgold0 -
"Turning off" content to a site
One site I manage has a lot of low quality content. We are in the process of improving the overall site content but we have "turned off" a large portion of our content by setting 2/3 of the posts to draft. Has anyone done this before or had experience with doing something similar? This quote from Bruce Clay comes to mind: “Where a lot of people don’t understand content factoring to this is having 100 great pages and 100 terrible pages—they average, when the quality being viewed is your website,” he explained. “So, it isn’t enough to have 100 great pages if you still have 100 terrible ones, and if you add another 100 great pages, you still have the 100 terrible ones dragging down your average. In some cases we have found that it’s much better, to improve your ranking, to actually remove or rewrite the terrible ones than add more good ones.” What are your thoughts? Thanks
On-Page Optimization | | ThridHour0 -
Alt Tags On "VIEW INVENTORY" Button
I have an E-commerce site that sells events, and tickets. By default it shows 10 events per page, each event with its own "View Inventory Button" which leads a customer to a list of tickets for that particular event. My question is that by default ea event page has 10 listings all with View Inventory buttons, should I just remove ALL alt tags? For example if it was football game with Detroit lions, and the Detroit lions page shows 10 events by default, should each of my View tickets buttons say EX. "Buy Lions tickets"? I am so confused, i have an understanding of how and what alt tags do, but I am afraid to "over optimize the pages? I am just not sure how many times to have this alt tag visible with keywords in them, as the rest of the page is optimized in my descriptions and I would want to avoid keyword stuffing. Currently all that I can see how is "view tickets" view tickets" 10times as alt tags. Any help would be MUCH appreciated!!!! This was a response in the past from someone in the forums 'Depending what language/CMS your website is built on, you will be able to insert a bit of code that dynamically creates a suitable alt tag depending on the product. So whatever page/product template currently instructs the alt tag to be 'buy now', would instead instruct a dynamic name to be generated along the format of 'buy button for"
On-Page Optimization | | TP_Marketing0 -
How do I address "Critical Factors: Accessible to Engines"?
Hello,I am going thru the on-page report card produced by SEOMOZ and am stumped as to how to address the first critical factor. It looks like the correct meta tag to get search engines to index the site is at the bottom of the header. And as far as I know, which isn't much, the site returns the HTTP code 200 when I refresh.I am new at this, so please let me know if you have some specific solutions. I am using IWeb and the IWeb SEO Tool to make meta code improvements. I have pasted the head code for my website (www.grass2greens.com) below. Thanks in advance!<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="iWeb 3.0.4" name="Generator"><meta content="local-build-20120619" name="iWeb-Build"><meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible"><meta content="width=880" name="viewport"><title>Grass to Greens: Asheville Edible Landscapingtitle><link href="Grass_to_Greens__Asheville_Edible_Landscaping_files/Grass_to_Greens__Asheville_Edible_Landscaping.css" media="screen,print" type="text/css" rel="stylesheet"><style type="text/css"><script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"><script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"><script src="Scripts/iWebSite.js" type="text/javascript"><script src="Scripts/iWebImage.js" type="text/javascript"><script src="Scripts/iWebMediaGrid.js" type="text/javascript"><script src="Scripts/Widgets/SharedResources/WidgetCommon.js" type="text/javascript"><script src="Scripts/Widgets/HTMLRegion/Paste.js" type="text/javascript"><script src="Grass_to_Greens__Asheville_Edible_Landscaping_files/Grass_to_Greens__Asheville_Edible_Landscaping.js" type="text/javascript"><script type="text/javascript"><meta content="Grass to Greens offers a range of edible landscape design, consultation, installation, and maintenance services. Free Consultations! We specialize in beautiful and useful vegetable gardens, season extension, tree work, orchards and food forests, stone work, fencing, and rain water catchment. Grass to Greens is an edible landscaping company committed to creating food security and fostering social justice through urban agriculture in the Asheville area. " name="description"><meta content="Landscaping Asheville Edible Gardens" name="keywords"><meta content="follow,index" name="robots"><link rel="stylesheet" type="text/css" href="Grass_to_Greens__Asheville_Edible_Landscaping_files/Grass_to_Greens__Asheville_Edible_LandscapingMoz.css">head> Grass to Greens: Asheville Edible Landscaping
On-Page Optimization | | dcaudio0 -
Why isn't SEOMoz using File Extensions (*.html etc) on any of their web page URLs?
...and what is the SEO benefit of this? This video from Matt Cutts suggests using file extentions, except for a directory.
On-Page Optimization | | magicrob0