Adding Something to htaccess File
-
When I did a google search for site.kisswedding.com (my website) I noticed that google is indexing all of the https versions of my site.
First of all, I don't get it because I don't have an SSL certificate. Then, last night I did what my host (bluehost) told me to do. I added the below to my htaccess file.
Below rule because google is indexing https version of site - https://my.bluehost.com/cgi/help/758RewriteEngine OnRewriteCond %{HTTP_HOST} ^kisswedding.com$ [OR]RewriteCond %{HTTP_HOST} ^kisswedding.com$RewriteCond %{SERVER_PORT} ^443$RewriteRule ^(.*)$ http://www.kisswedding.com [R=301,L]
Tonight I when I did a google search for site:kisswedding.com all of those https pages were being redirected to my home page - not the actually page they're supposed to be redirecting to.
I went back to Bluehost and they said and 301 redirect shouldn't work because I don't have an SSL certificate. BUT, I figure since it's sorta working I just need to add something to that htaccess rule to make sure it's redirected to the right page.
Someone in the google webmaster tools forums told me to do below but I don't really get it?
_"to 301 redirect from /~kisswedd/ to the proper root folder you can put this in the root folder .htaccess file as well:_Redirect 301 /~kisswedd/ http://www.kisswedding.com/"
Any help/advice would be HUGELY appreciated. I'm a bit at a loss.
-
Hi Susanna,
Just wanted to post a quick update on this question since I understand the problem was resolved with the suggestions that we made after looking at the content of your .htaccess file.
The major issue with the original redirect was that the $1 had been omitted from the Rule. So the problem actually was not related to the secure protocol - just a coding error
Example code for the secure to non-secure redirect you needed to implement:
redirect away from https to http
RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com$1 [R=301,L]Hope that's helpful for anyone who may be looking for help with the same issue in the future.
Sha
-
Hi Susanna,
If you have trouble getting someone to fix the .htaccess for you, feel free to private message the file and we'll be able to sort it out for you.
It is never advisable to treat rules in the .htaccess in isolation as the order in which they appear in the file will determine how things work as Ryan explained. There are also other things that will influence whether the redirects function the way you want them to such as rules added to the file or overwritten by standard installations such as Wordpress, Joomla etc.
Hope your provider can get it sorted out for you. If not, just let us know and we'll be happy to help.
Sha
-
Thanks Ryan. I appreciate that. I had no idea that copy and pasting could cause so many problems. I'll try and see if I can speak with a supervisor.
Have a great night/day!
-
Hi Susan.
I will share two items regarding your situation. First, the modifications to your htaccess file involve a replacement language called Regex. The code you are copying and pasting are regex expressions. Basically they say "when a URL meets this condition, rewrite the URL as follows....". In your case, the original regex expression was not correctly written (a common occurrence) so you did not receive the desired effect.
The changes need to be made in your .htaccess file. The htaccess file controls all access to your website. A single character out of place can mean your entire site is unavailable, URLs are improperly redirected, or security holes are open on your site. On the one hand, you can copy and paste code into your htaccess file and it may work. On the other hand damage can be done. It also makes a difference where you locate the code within the file. Varying the location alters the logic and can lead to different results.
Based on the above it is my recommendation your host make the changes. If your host is unwilling to help, I would recommend asking to be assigned to another tech or a supervisor. Most hosts are very helpful in this area. If the host is not willing to help, perhaps you can ask your web developer to make the change.
If you decide to make the change yourself I recommend you doing some online research into how the htaccess file works. You do not want to fly blind in this file.
Suggested reading: http://net.tutsplus.com/tutorials/other/the-ultimate-guide-to-htaccess-files/
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
-
Unsolved URL Crawl Reports providing drastic differences: Is there something wrong?
A bit at a loss here. I ran a URL crawl report at the end of January on a website( https://www.welchforbes.com/ ). There were no major critical issues at the time. No updates were made on the website (that I'm aware of), but after running another crawl on March 14, the report was short about 90 pages on the site and suddenly had a ton of 403 errors. I ran a crawl again on March 15 to check if there was perhaps a discrepancy, and the report crawled even fewer pages and had completely different results again. Is there a reason the results are differing from report to report? Is there something about the reports that I'm not understanding or is there a serious issue within the website that needs to be addressed? Jan. 28 results:
Reporting & Analytics | | OliviaKantyka
Screen Shot 2022-03-16 at 3.00.52 PM.png March 14 results:
Screen Shot 2022-03-15 at 10.31.22 AM.png March 15 results:
Screen Shot 2022-03-15 at 4.06.42 PM.png0 -
PPC ads: landing page vs website page ... other metrics to consider?
I run 3 PPC ads in Chinese language on Baidu, of which one landing page consistently ranks around 5th amongst 80+ other English website pages. So, when our site was recently developed for Chinese language, I redirected the ads to the relevant Chinese website pages for a month to see which would attract more visitors (Chinese landing pages vs Chinese website). I haven't fully analysed the results yet, but what other metrics should I consider than just the volume of visitors? Landing page
Reporting & Analytics | | SteveMauldin
https://www.mogas.com/en-us/ppc-ads/mogas-球阀
https://www.mogas.com/en-us/ball-valves (in English) Website page
https://www.mogas.com/zh-cn/产品
https://www.mogas.com/en-us/products (in English)0 -
Something does not add up with WMTs search analytics data
we recently replatformed our main site and switched to https. For the first 2-3 weeks after we moved organic traffic was great, we did not lose any ( increased a little), but then it dropped off significantly. Attached is a screenshot from one of our main keywords that dropped off. You can see click (blue) and impressions (red) dropped off, and the position became unstable, but in the last week it has stabilised to about the same position it was before, but the clicking and impressions are still very low. The keyword is generic (for our industry) and there would not be any major seasonal changes in the search volume. I can't make sense of this data, could be be wrong? Kd3p5f9.jpg
Reporting & Analytics | | PaddyDisplays1 -
Adding a Query String to a Static URL is that good or bad?
I just went through this huge process to shorten my URL structure and remove all dynamic strings. Now my analytics team wants to add query strings to track clicks from the homepage. Is this going to destroy my clean url structure by appending a query string to the end of the URL structure.
Reporting & Analytics | | rpaiva0 -
Why Pre roll Youtube video ads are being recorded into Organic Traffic?
Hi Mozzers, Last month, one of our clients(appliance and kitchen design) has started a video ad campaign on Youtube for a specific Appliance brand, since then I have noticed Organic traffic has been inflated. I was able to figure it out thanks to some keywords that we never ranked for. How is this possible? Google Analytics should at least be able to segment that into a Youtube Referral traffic.
Reporting & Analytics | | Ideas-Money-Art0 -
IP address changed, subdomains added - how will affect?
Hello, Two weeks ago we have changed IP address of our website, also we've added new subdomains for static content (like img.domain.com & js.domain.com) and changed the links on the site accordingly. The old IP is also working and the old links are accessible too. For some reason, since the change, we see a SE (google) traffic constant drop everyday. I've read only Google's support (http://support.google.com/webmasters/bin/answer.py?hl=en&answer=34437) that such change shouldn't affect the ranking anyhow. On the other hand I've consulted with SEO people and was told that such change may affect in the close new feature (for couple of weeks) and then bring the ranking back. I would like to hear another opinion, I want to get back to our board with approved answers. Please advice. Thanks.
Reporting & Analytics | | maddogx0 -
Robots.txt file issue.
Hi, Its my third thread here and i have created many like it on many webmaster communities.I know many pro are here so badly needs help. Robots.txt blocked 2k important URL's of my blogging site http://Muslim-academy.com/ Especially of my blog area which are bringing good number of visitors daily.My organic traffic declined from 1k daily to 350. I have removed the robots.txt file.Resubmitted existing Sitemap.Used all Fetch to index options and 50 URL submission option in Bing Webmaster Tool. What Can I do know to have these blocked URL's back in Google index? 1.Create a NEW sitemap and submit it again in Google webmaster and bing webmaster tool? 2.Bookmark,linkbuilding or share the URL's.I did a lot of bookmarking for blocked URL's. I fetch the list of blocked URLS Using BING WEBMASTER TOOLS.
Reporting & Analytics | | csfarnsworth0 -
How to track affiliate ads on Google analytics
Hi Im new google analytics user, I would like to track affiliates ads (banner flow -javascript) on my website. How to set up goals to track affiliate ads? thanks.
Reporting & Analytics | | info_tipovanie-stavkovanie.com0