My .htaccess has changed, what do i do to avoid it again...?
-
Hello
Today i notice that our site did not auto changed from without www to with, when i checked the .htaccess file i notice # in-front of each line and i know we did not insert it in there, after i removed it it worked fine.
The only changes that we did recently was to a mobile version to the site but the call to autodirect is in a JS and not in the .htaccess,
could it be the server..? is there any way that anything else might cause this...?
The site is HTML and WP could it be because of that...?
Thank's
Simo
-
Before you changed the file back did you see the last time it was modified? might give you a clue what happened. As Alan said check other files have not been changed (malware/hacked) again checking the modified dates gives you a clue ( files you know have not been touched having a recent modified date, all the files having the same modified date... etc)
-
Malware often changes the htaccess file, you should check to see if there is anything else in there.
WordPress sites are prone to being hacked. i develop in .net and have never ever had a site hacked, yet i see this is WP and joomla all the time.
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
-
Desktop Ranking Disappeared After URL Change; Mobile Ranking Improved
A client's developer moved a site onto a new (WordPress) CMS, where the only change was URLs - the front end code stayed the same. The site is 10+ years old and previously had fantastic rankings (#1-4) with inner pages for some relatively generic search phrases (eg 10,000 searches / month in the UK, per Keyword Planner). Now, on Desktop searches the site isn't appearing anywhere in the 300+ results for a key search phrase, where it used to rank between #2-4; however over the last 3 weeks on Mobile the site ranks better than before, even though the site isn't at all mobile-friendly (it's over 10 years old). During the move, there were some errors by their developer: mistakenly left in a sitewide rel=canonical tag referring to the homepage 3-4 301s before finally reaching new URLs a lot of 301s missed (250+ crawl errors appeared in Search Console) page content differentiation by parameter, instead of individual URLs For example, the page that used to rank for the targeted phrase, this left 4 different URLs indexed, with the same content. To tackle this, we have so far: put in correct rel=canonical tags set up Search Console to recognise URL parameter as differentiating content fixed all crawl errors appearing in Search Console added a link direct to the problem page, direct from the homepage stopped duplicate content being indexed (including for the page in question) ensured the page load speed is still good (< 0.75s) Ranking for Desktop over Mobile would make sense, but not Mobile over Desktop! I'd really appreciate any advice on how to tackle this. Thanks!
Technical SEO | | magicdust0 -
How do I avoid this issue of duplicate content with Google?
I have an ecommerce website which sells a product that has many different variations based on a vehicle’s make, model, and year. Currently, we sell this product on one page “www.cargoliner.com/products.php?did=10001” and we show a modal to sort through each make, model, and year. This is important because based on the make, model, and year, we have different prices/configurations for each. For example, for the Jeep Wrangler and Jeep Cherokee, we might have different products: Ultimate Pet Liner - Jeep Wrangler 2011-2013 - $350 Ultimate Pet Liner - Jeep Wrangler 2014 - 2015 - $350 Utlimate Pet Liner - Jeep Cherokee 2011-2015 - $400 Although the typical consumer might think we have 1 product (the Ultimate Pet Liner), we look at these as many different types of products, each with a different configuration and different variants. We do NOT have unique content for each make, model, and year. We have the same content and images for each. When the customer selects their make, model, and year, we just search and replace the text to make it look like the make, model, and year. For example, when a custom selects 2015 Jeep Wrangler from the modal, we do a search and replace so the page will have the same url (www.cargoliner.com/products.php?did=10001) but the product title will say “2015 Jeep Wrangler”. Here’s my problem: We want all of these individual products to have their own unique urls (cargoliner.com/products/2015-jeep-wrangler) so we can reference them in emails to customers and ideally we start creating unique content for them. Our only problem is that there will be hundreds of them and they don’t have unique content other than us switching in the product title and change of variants. Also, we don’t want our url www.cargoliner.com/products.php?did=10001 to lose its link juice. Here’s my question(s): My assumption is that I should just keep my url: www.cargoliner.com/products.php?did=10001 and be able to sort through the products on that page. Then I should go ahead and make individual urls for each of these products (i.e. cargoliner.com/products/2015-jeep-wrangler) but just add a “nofollow noindex” to the page. Is this what I should do? How secure is a “no-follow noindex” on a webpage? Does Google still index? Am I at risk for duplicate content penalties? Thanks!
Technical SEO | | kirbyfike0 -
How to recover search volume after domain name change?
On the 3rd of November we changed our company name and domain. The new site was not changed at all so the 301 process was quite straightforward. The change over was successful, no downtime, all pages redirected correctly (with a few minor exceptions). However, after a few days we started to see more and more links into the new site from the old site. They now stand at over 3 million. And links from the new site to the old site of over 200K. Links from the new site back to the old, were due to us having left a lot of links tucked away on various pages which were possibly causing loops with the 301 redirects on the old site. We fixed these and now there are no remaining links back to the old site, though we are still showing just over 200K links back to the old site. We are also seeing a LOT more back-links on the new site from old junk sites, which are not showing for the old site. A couple of years ago we went through about a year of trying to track down and remove thousands of spam backlinks. We did what we could, got a lot removed, showed Google the evidence, then Google lifted the penalty and said they had made some changes that meant the links were no longer causing the penalty. I added the old disavow file to the new site, but it doesn't cover a fraction of the sites which are being displayed as providing backlinks... many of which are clearly spammy. Is it possible that Google made some manual actions to lift the penalties but failed to associate these changes with the new domain? Changes that were not included in the disavow file? All help appreciated.
Technical SEO | | Exotissimo0 -
Https and 404 code that goes into htaccess
The 404 error code we put into htaccess files for our websites does not work correctly for our https site. We recently changed one of our http sites to https. When we went to create a 404.html page for it by creating an htaccess folder with the 404 error code in it, once we uploaded the file all of our webpages were displaying incorrectly, as if the css was not attached. The 404 code we used works successfully for our other 404.html pages for our other sites (www.telfordinc.com/404.html). However, it does not work for the https site. Below is the 404 error code we are using for our https site (currently not uploaded until pages display correctly) ErrorDocument 404 /404-error.html RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?privatemoneyhardmoneyloan.com/.*$ [NC] RewriteRule .(gif|jpg|js|css)$ - [F] Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.privatemoneyhardmoneyloan.com$ [NC] RewriteRule ^(.*)$ http://www.privatemoneyhardmoneyloan.com/$1 [R=301,L] So we want to know if there is a different 404 error code that goes into the htaccess file for an https vs. http? Appreciate your feedback on this issue
Technical SEO | | Manifestation0 -
Changing a site from http to https
Will my rankings be affected if I change domain from http to https and force redirect?
Technical SEO | | Clickatell20 -
How to avoid duplicate content penalty when our content is posted on other sites too ?
For recruitment company sites, their job ads are posted muliple times on thier own sites and even on other sites too. These are the same ads (job description is same) posted on diff. sites. How do we avoid duplicate content penalty in this case?
Technical SEO | | Personnel_Concept0 -
My Old Domain is Not Changing in Google
I have taken over the following domain www.choice-cottages.co.uk, part of the contract was to re-direct the old site www.choicecottages.info to the new site. Unfortunately I am only a middle man in the arrangement as the website is hosted with another company. The switch was done well over 4 weeks ago, the re-direct itself is working fine. However if you google choice cottages you will see the first listing is www.choicecottages.info, then I have my new site below for a few listings. Google is definitely updating something as before the old domain had lots of site links but this has reduced to a few. Does anyone know anything on this, as in the past it only takes a couple of days to update. Many thanks Andy
Technical SEO | | iprosoftware0 -
Does changing nameservers negatively impact SEO?
Had to redirect the nameservers to the hosting account in order for the domain email addresses to work. Since then, search results have dropped from the first page to second and much lower with the same keywords. Does that make sense? Another change was redirecting approx 10 parked domains to the main site, was that a mistake?
Technical SEO | | reeljerc0