"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
-
Does blogging with a wysiwyg negatively affect SEO (vs. hand coding)?
Many bloggers use a wysiwyg editor to write posts. Are there any drawbacks to wysiwyg vs plain text? When I write blogs I prefer to hand code my text to be sure everything is optimized. My feeling is that wysiwyg leads to code bloat and generally fewer optimization opportunities. I have no real evidence. Is there any reason not to use the wysiwyg editor?
On-Page Optimization | | Jason-Rogers0 -
Screaming Frog - What are your "go to" tasks you use it for?
So, I have just purchased screaming frog because I have some specific tasks that need completing. However, looking at Screaming Frog generally, there is so much information I was wondering for those who use it, what are the top key tasks you use it for. I mean what are your "go to" things you like to check, that perhaps are not covered by the Moz Crawl reports. Just looking for things I perhaps hadn't thought about, that this might be useful for.
On-Page Optimization | | TheWebMastercom0 -
Rel="canonical" link should they be to or from an "SEO friendly" url
Thanks for taking the time to review this. So for our example, lets use the following SEO friendly link: http://hiu.calibermediagroup.com/undergraduate-on-campus/academics/colleges/pacific-christian-college-of-ministry-and-biblical-studies/BA-biblical-studies We'll call this link the SEO VERSION The title of the college is" Pacific Christian College of Minstry and Biblical Studies" The title of the program is "BA Biblical Studies" The QUERY version of the link to this page would be something like: http://hiu.calibermediagroup.com/undergraduate-on-campus/academics/colleges/index.php?collegeid=22&programid=34 Keep in mind that the meta title, description, and keyword tags for the page are all administerable The SEO VERSION is automatically created from the title of the college, and the title of the program. Each one of these titles can be overidden with a URL slug individually. For instance, the admin could make the link: http://hiu.calibermediagroup.com/undergraduate-on-campus/academics/colleges/pacific-christian-college-of-ministry/biblical-studies by changing the slug for the college to "pacific-christian-college-of-ministry" and the slug for the program to "biblical-studies". Let's call this version the SLUG VERSION So now we have multiple ways to get to the same content. The question on the table is what is best practice for the rel="canonical" link to keep from getting dinged for duplicate content. Let's say that our SEO VERSION is the canonical link for 1 year. Then the choice was made to optimize the links thru the slugs creating the SLUG VERSION. My assumption is that we would keep the SEO VERSION as the canonical link. But then let's say 6 months later that the title of the program is changed in the admin. Now the SEO VERSION has changed and so has the canonical link. Do we lose the link juice garnered over the last 18 months? It would seem to me, that if we use the QUERY version as the canonical link, then any optimizations or changes affect everything except the canonical link, thus keeping the previous link juice earned. But is having an ugly URL as the canonical link detrimental to SEO? Please advise.
On-Page Optimization | | robertdonnell0 -
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 -
Should I consolidate pages to prevent "thin content"
I have a site based on downloadable images which tend to slow a site. In order to increase speed I divided certain pages up so that there will be less images on each page such as here: http://www.kindergartenteacherresources.com/2011/09/23/spongebob-alphabet-worksheets-uppercase-letters-a-h/ http://www.kindergartenteacherresources.com/2011/09/23/spongebob-alphabet-worksheets-uppercase-letters-i-q/ http://www.kindergartenteacherresources.com/2011/09/23/spongebob-alphabet-worksheets-uppercase-letters-r-z/ The problem is that I now have potential duplicate content and thin content. Should I consolidate them and put all of the content from the 3 pages on one page? or maybe keep them as they are but add a rel previous / next tag? or any other suggestion to prevent a duplicate/thin content penalty while not slowing down the site too much?
On-Page Optimization | | JillB20130 -
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 -
Transition between a blog to e-commerce webshop, will my domain "lose" authority
Hi Seomoz'ers, Currently I am analyzing the best possible strategy which situation is as follow: I am having a blog with a great EMD about a specific product we are selling. The blog is currently ranking in position 1 for different keyword phrases. However I would like to make a switch from the current Wordpress blog to Magento webshop. Simply because the product should be sold through a professional webshop with many related products. Only the homepage of mydomainname.com is optimized. I am affraid I will lose my #1 ranking when I put my webstore online on this domainname. Most likely I will lose my PA and keep my DA. Which actions should I take in order to keep the ranking in Google position 1 with the new webstore? My best possible option I guess: 1. Replace the Wordpress blog with the Magento webstore and optimize the homepage with on-page seo of the webstore for the targeted keywords. Will this work? As the backlinks I've built are pointing all to the domainname.com (homepage). Thanks in advance. Any more suggestions are welcome 🙂
On-Page Optimization | | Falcopa0 -
How could I avoid the "Duplicate Page Content" issue on the search result pages of a webshop site?
My webshop site was just crawled by Roger, and it found 683 "Duplicate Page Content" issues. Most of them are result pages of different product searches, that are not really identical, but very similar to each other. Do I have to worry about this? If yes, how could I make the search result pages different? IS there any solution for this? Thanks: Zoltan
On-Page Optimization | | csajbokz0