"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
-
"Google-selected canonical different to user-declared" - issues
Hi Moz! We are having issues on a number of our international sites where Google is choosing our page 2 of a category as the canonical over page 1. Example; https://www.yoursclothing.de/kleider-grosse-groessen (Image attached). We currently use infinite loading, however when javascript is disabled we have a text link to page 2 which is done via a query string of '?filter=true&view=X&categoryid=X&page=2' Page 2 is blocked via robots.txt and has a canonical pointing at page 1. Due to Google selecting page 2 as the canonical, the page is no longer ranking. For the main keyphrase a subcategory page is ranking poorly. LqDO0qr
On-Page Optimization | | RemarkableAgency1 -
Duplicate content - "Same" profile-information
Hi, I own a casting website with lots of profiles. Some of these profiles only typed in their firstname, email and age, when they registered on the site, and they haven't added more information ever since. From Crawl Diagnostics, I can see that there is "lots" of these profiles, which looks exactly the same (only showing age and firstname), allthought they are not the same. I could add which day the profile were created on the site, to maybe avoid these "duplications". The email will always be hidden. Or, how big an issue is this? Crawl Diagnostics tells me, that there is around 200 of these, and they are "marked" as High Priority. Any ideas on what to do? /Kasper
On-Page Optimization | | KasperGJ0 -
Disavow Tool Submitting 2nd File
Hi About 2 Months ago I submitted a Disavow File using the Disavow Tool I have collected more links and I am ready to upload a 2nd File, However should I download the previous file in Webmaster Tools (Disavow Tool) and add these new links to that File or if I just upload and override the existing file with this file containing new links only will that be ok. What I dont want to do is do something that removes all the previous findings from the list so that google cannot see them anymore. I guess what I am trying to say is does Google just refer to the live file I am updating / overriding or once I have submitted a file weather i remove it or not will google still have a record of it and be referring to it ? Thanks Adam
On-Page Optimization | | AMG1000 -
"og:description" vs. name="description"
According to Rock Your SEO with Structured Social Sharing "OG description overrides meta description tag." Moz Crawl Diagnostics seems to ignore og:description and only look for meta name="description" - does that mean my meta descriptions tags should be meta name?
On-Page Optimization | | leighw0 -
How to "on page" seo a small local service business - particularly headers
First off, let me apologize if this question is posted elsewhere, worded differently. I've looked around quite a bit and have been unable to find the answer. Basically, we are a small web design firm just getting our feet with with SEO. Most of our clients, especially initially, will be quite small, local, service businesses. For example: and electrician, a pet sitter, a retail printing and map store, a surgeon etc. Almost all of their sites will follow a basic "business card on the web" format... Home Page - About Us - Testimonials - Rates - FAQ - Contact Us - Etc So, from what I've read about on-page optimization, making sure my keywords are in the title, header, body, and meta description is one of the easiest and quickest things we can do for our clients. This is a straightforward concept for me when applied to the homepage. For example, take the local pet sitting business. Her keywords are: Pet sitting, Dog walking, and the city we live in, Anytown USA. So, I've used those keywords in all the appropriate places on the home page: title: Dog Walking and Pet Sitting Service in Anytown USA header: Dog Walking and Pet Sitting Service in Anytown USA first sentence of body: We are a professional Dog Walking and Pet Sitting Service in Anytown USA meta description: We are a professional Dog Walking and Pet Sitting Service in Anytown USA. At Business Name your furry friends become a part of our family. So, my question is: Do I also optimize the "about us" page? I've changed the title of all the pages to follow this format: Dog Walking and Pet Sitting in Anytown USA - Home Dog Walking and Pet Sitting in Anytown USA - About Us Dog Walking and Pet Sitting in Anytown USA - Rates Dog Walking and Pet Sitting in Anytown USA - FAQ Dog Walking and Pet Sitting in Anytown USA - Etc Easy enough so far. Also pretty easy for the meta description, and the body. However, how would I add keywords to the header without making it look ridiculous? We use wordpress with the genesis framework, and child themes from studiopress. The header is always prominently visible at the top of the page. Most people would expect to see the header be the same as the link they clicked on the nav bar: for example, on the "about us" page, people expect the header to be: "about us" Not: "dog walking and pet sitting in Anytown USA - About Us" Do I just not worry about the headers on the other pages? For that matter, I'd really like people to "land" on the home page, not any of the other pages, so should I not optimize them at all? Does optimizing the rest of the pages help the home page to show up higher in the SERPS? If I do end up optimizing the rest of the pages, should I use slightly different spellings of the keywords: like Dog walker instead of dog walking? Or pet sitter instead of pet sitting? I've repeatedly seen people talk about not using the same keywords on more than one page... but for most of these businesses there are really fairly few keywords. There just isn't that many different ways that someone is going to search for an electrician, or a plumber, or a pet sitter. By the second or third page that I optimize on one site, I imagine I'll start running out of different variations of the keywords. I recognize that a lot of what we'll do that will be most helpful to local clients has nothing to do with on page optimization (setting up google places, google+, yahoo + bing local, etc). I'd just like to make sure that I'm doing the on page stuff as perfectly as possible. Thanks for your time and responses! -Matt p.s. while I'm at it, let me ask another question about domain names as well. Right now the pet sitting client mentioned above is using: www.petcare_Anytown_.com After operating her business for the last year she realized she is much more interested in dog walking than pet sitting. We are in the processes of redesigning the site, and when finished, are considering moving it to: www.dogwalking_Anytown_.com My assumption is that as long as we use permanent redirects from the old site to the new one, we shouldn't lose much SEO value. Is this thinking correct? On a related note though: another article I read mentioned that using a brand name in the domain may actually be more useful than the keyword rich domains above. However, www._businessname._com happens to already be taken by a pet sitting business at the other end of the country. We could however use: www.businessnameAnytown.com Which one do you think would work better? The keyword/location domain, or the businessname/location domain? Thanks!
On-Page Optimization | | Webformix0 -
On page "F" and I changed my tags long ago to match everything and still F?
My on-page analysis shows that my title tags are not supporting my keyword..........but they are! My title tag has my EXACT keyword phrase. What gives? Keyword is "San Diego Party Bus" Title is "San Diego Party Bus | xoxoxox | xoxoxoxo" F grade! ????????
On-Page Optimization | | DrewSpinoso0 -
Title Tag: Phrases vs. Keywords Separated by "|"
Hello, One of my client's old sites has all category titles of the form (for example) running shoes | running shoe | walking shoes | walking shoe including many that perform well with over 60 characters. I'm in the process of rewriting the titles into something like Running and Walking Shoes, A quality shoe at OurShoes.com The reason I'm rewriting them is for future google penalties, and to look better to possible guest post opportunities. Also to look better in the SERPS But the old style is performing very well. What are the real pros and cons of each? Thanks.
On-Page Optimization | | BobGW0 -
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 | | MitchellStoker0