What is the difference between the two rewrite rules in htaccess?
-
Force www. prefix in URLs and redirect non-www to www
RewriteCond %{HTTP_HOST} !^www.domain.com.ph
RewriteRule (.*) http://www.domain.com.ph/$1 [R=301,L]Force www. prefix in URLs and redirect non-www to www - 2nd option
RewriteCond %{HTTP_HOST} ^domain.com.ph [NC]
RewriteRule (.*) http://www.domain.com.ph/$1 [R=301,L] -
Thanks Peter!
-
Yes, the result is identical.
Peter
-
So in theory they are identical?
Just different ways of achieving the same result
-
Hi, as mentioned in the other answer I gave here: http://moz.com/community/q/where-is-the-rule-here-that-force-www-in-urls#reply_202351
the first checks for non-inclusion of the www in the URL (the !^www checks if www is not included at the start of the URL being tested), the second checks for a URL that starts with just the domain.
Peter
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
-
Doorway v Landing Pages - Whats the difference?
I suppose I have not much further information to add apart from ask apart from what is the difference? Both are highly optimized pages but that's where my knowledge ends!
White Hat / Black Hat SEO | | loudawg0 -
What could go wrong? SEO on mobile site is different than desktop site.
We have a desktop site that has been getting worked on over the year regarding improving SEO. Since the mobile site is separate, the business decided to not spend the time to keep it updated and just turned it off. So any mobile user that finds a link to us in search engines, goes to a desktop site that is not responsive. Now that we're hearing Google is going to start incorporating mobile user friendliness into rankings, the business wants to turn the mobile site back on while we spend months making the desktop site responsive. The mobile site basically has no SEO. The title tag is uniform across the site, etc. How much will it hurt us to turn on that SEO horrid mobile site? Or how much will it hurt us to not turn it on?
White Hat / Black Hat SEO | | CFSSEO0 -
Competitor owns two domains which are essentially duplicates. Is this allowed?
Hello everyone,One of my competitors has two E-commerce sites that are almost exactly the same. The company re-branded a few years ago (changed the company name, changed the domain name) but kept the first domain live which is still fairly successful. Their re-branded website is a Top 1000 retailer.The thing is, both websites are essentially the EXACT SAME. They have the same products (with the same item #'s), the same pricing, the same copy and product descriptions, the same contact info, same layout, etc. The internal search bar on the first domain even redirects to their current site! The only real difference are the brand names. Currently, both sites are ranking very well for some very competitive keywords. For the past two years, I kept waiting for Google to penalize one (or both) of them for duplication. But for some reason Google seems to have not noticed. **Is there any way to "show google" site duplication they might be missing?**Thanks!
White Hat / Black Hat SEO | | bpharris90141 -
Thousands of 301 redirections - .htaccess alternatives?
Hi guys, I just want to ask if there are other possible issues/problems (other than server load) once we implement 301 redirections for 10,000+ URLs using .htaccess. Are there other alternatives?
White Hat / Black Hat SEO | | esiow20130 -
Are multiple domains spammy if they're similar but different
A client currently has a domain of johnsmith.com (not actual site name, of course). I’m considering splitting this site into multiple domains, which will include brand name plus keyword, such as: Johnsmithlandclearing.com Johnsmithdirtwork.com Johnsmithdemolition.com Johnsmithtimercompany.com Johnsmithhydroseeding.com johnsmithtreeservice.com Each business is unique enough and will cross-link to the other. My questions are: 1) will Google consider cross-linking spammy? 2) what happens to johnsmith.com? Should it redirect to new site with the largest market share, or should it become an umbrella for all? 3) Any pitfalls foreseen? I've done a fair amount of due diligence and feel these separate domains are legit, but am paranoid that Google will not see it that way, or may change direction in the future.
White Hat / Black Hat SEO | | SteveMauldin0 -
Multiple domains different content same keywords
what would you advice on my case: It is bad for google if i have the four domains. I dont link between them as i dont want no association, or loss in rakings in branded page. Is bad if i link between them or the non branded to them branded domain. Is bad if i have all on my webmaster tools, i just have the branded My google page is all about the new non penalized domain. altough google gave a unique domain +propdental to the one that he manually penalized. (doesn't make sense) So. What are the thinks that i should not do with my domain to follow and respect google guidelines. As i want a white hat and do not do something that is wrong without knowledge
White Hat / Black Hat SEO | | maestrosonrisas0 -
What is the difference between advertizing and a paid link?
I have been told that google frowns on paid links yet I see many site charging for advertizing and the advertizing consists of an anchor text link. What is the difference between a paid link and this type of advertizing?
White Hat / Black Hat SEO | | casper4340 -
Difference between Syndication, Autoblogging, and Article Marketing
Rands slide deck titled 10 Steps to Effective SEO & Rankings from InfusionCon2011 on slide 82 recommends content syndication as a method for building traffic and links. How is this any different than article marketing? He gave an example of this using a screenshot of this search result for "headsmacking tip discussion." All of those sites that have republished SEOmoz's content are essentially autoblogs that post ONLY content generated by other people for the purpose of generating ad clicks from their organic traffic. We know that Google has clearly taken a position against these types of sites that offer no value. We hear Matt Cutts say to stay away from article marketing because you're just creating lots of duplicate content. Seems to me that "syndication" is just another form of article marketing that spreads duplicate content throughout the web. Can someone help me understand the difference? By the way, the most interesting one I saw in those results was the syndicated article on businessweek.com!.
White Hat / Black Hat SEO | | summitseo0