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/
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
-
Transitioning to HTTPS, Do i have to submit another disavow file?
Hi Mozzers! So we're finally ready to move from http to https. Penguin is finally showing us some love due to the recent algorithm updates. I just added the https to Google search console and before 301 redirecting the whole site to a secure environment.....do i upload the same disavow file to the https version? Moreover, is it best to have both the http and https versions on Google Search console? Or should I add the disavow file to the https version and delete the http version in a month? And what about Bing? Help.
Reporting & Analytics | | Shawn1240 -
Google Analytics Goal/Event/SOMETHING to show only Wordpress "Posts", not pages, etc
Hi all, Our site is build on Wordpress and formerly the post URL's had the typical date format at the beginning. This made it easy for me to look at, for example, all search traffic to the blog. I would just view URL's containing /2014/ and /2015/ and boom. We have since removed the dates from the URL's with proper redirects etc, which is great, but now I can't figure out a way to look at ONLY the blog in GA. I like to track a KPI of 'search visits to blog posts' and I can't figure out how to now. Can I set up a GA event that only fires when the post type template for blog posts loads? Some other solution? I'm lost here, and there's gotta be a good way to do it...
Reporting & Analytics | | 3DR0 -
Best way to block spambots in htaccess
I would like to block Russian Federation, China and Ukraine spam as well as semalt and buttonsforwebsite. I have come up with the following code, what do you think? For the countries: BLOCK COUNTRY DOMAINS RewriteCond %{HTTP_REFERER} .(ru|cn|ua)(/|$) [NC]
Reporting & Analytics | | ijb
RewriteRule .* - [F] And for buttons-for-website.com and semalt-semalt.com: BLOCK REFERERS RewriteCond %{HTTP_REFERER} (semalt|buttons) [NC]
RewriteRule .* - [F] or should it be: BLOCK USER AGENTS RewriteCond %{HTTP_USER_AGENT} (semalt|buttons) [NC]
RewriteRule .* - [F] Could I add (semalt|buttons|o-o-6-o-o|bestwebsitesawards|humanorightswatch) or is that too many?0 -
Google Ad referral
I was wondering if someone could decode the jumble of a referral - this is supposedly the referal that led to a click through to my site via a product listing ad. I am trying to figure out how www.nextag.com comes in to the picture as we do not have refurbexperts even listed there? Thanks to anyone who tries/does work it out. http://www.googleadservices.com/pagead/aclk?sa=L&ai=CGXud6DmDU_qeL5THygHpuICwCaTZwMYD_Nvvv0bEwMS50wEIBhAEIOn5-gEoBVCl7P7f-v____8BYMnu8omYpPQSoAHAhIv9A8gBB8gDG6oEJ0_QwcNc5zNun_d7S5KNcMT6uPjjH_mMDkKFFgBCQ6aKICRPJVVa7MAFBYgGAaAGJoAHqPv0ApAHAeASupqdo-ypit0m&ohost=www.google.com&cid=5GhZEzUCSC6x9n2wxOdz3-mrAfSUkvHKPN3wD5yLInnlNil_&sig=AOD64_1D1z1JPYbFP0UnUglJVOfvd25RfA&adurl=http://refurbexperts.com/product/527/HP-LaserJet-P2015-Laser-Printer-RECONDITIONED%3Futm_source%3Dproductlistingads%26utm_medium%3Dadwords%26utm_campaign%3Dadwords&ctype=5&nb=0&res_url=http%3A%2F%2Fwww.nextag.com%2Fhp-p2015-laserjet%2Fproducts-html%3Fnxtg%3D116d0a1c0504-9FFEB16DE52A7E2A&rurl=http%3A%2F%2Fwww.nextag.com%2Fgoto.jsp%3Fp%3D3652%26search%3Dhp%2520p2015%2520laserjet%26t%3Dag%253D1384181795%26crid%3D48271786%26gg_aid%3D20169721025%26gg_site%3D%26gclid%3DCjgKEAjwzIucBRDzjIz9qMOB3TASJABBIwL1LHK7GcAPS6yHGpd9Kq3wsZrcPORAWD8QCWivr4W75PD_BwE&nm=11&nx=43&ny=12&is=700x181&clkt=187
Reporting & Analytics | | henya0 -
Organic Traffic Drop and Rank Increase After Video Thumbnail added
So my company has created a large amount of videos and I took a couple of them and created a test video sitemap to see what effect adding a video thumbnail/rich snippet to the SERPs would be. It worked on one page and gained 2 spots (position 6 to 4) for the highest keyword, but traffic didn't increase too much. Then a week later I tested it with the page that we get the most organic traffic for, which is ranking for a very big keyword. It worked and gained a bit of ranking, but traffic decreased 50% ever since according to Google Analytics. It seems to me that the traffic from users clicking on the video thumbnail is not be tracked as google / organic even though it lands them on the intended page/doesn't redirect anywhere else. I've looked to see if traffic to this page increased overall to see if it was being tracked via a referral or as something else, but couldn't find any traffic discrepancy. The only thing I did find is that impressions under SEO > Landing Pages > Video Property increased, but this could be from the page ranking in the Video SERPs now. Has anyone experienced a similar situation? Do you think having a video snippet could be that big of a turn off for customers that people just aren't clicking like they used to? I don't think so, that's why I'm leaning towards a tracking discrepancy in Google Analytics.
Reporting & Analytics | | OfficeFurn0 -
Adding More Brand Rules
I'd really love if SEOMoz would let us add more than 10 brand rules. In GA, I've set up approximately 25 Advanced Segment Keyword Exclusions (using Regular Expressions) in order to filter out all the mispelled branded keywords sending us traffic. It's just a shame I can't do the same in SEOMoz, which essentially renders the branded/non-branded feature useless for me. Any suggestions?
Reporting & Analytics | | TeachersMutualBank0 -
What is the SEO Impact of Adding a Directory to URL
I would like to add a new directory named “products” for all of the product detail pages on my site. Instead of having the URL for a product be “mysite.com/product-details-page.aspx” we would like to change it to “mysite.com.com/products/product-detail-page.aspx.” I want to do this to enable us to add product pages to our traffic funnel analysis by filtering visits to the "product" directory - right now we can't track visits to product pages in the funnel because they are just one-off the main site. I know this change will require redirects for every single product. Is there anything else that needs to be done? My main question is, will this change negatively impact the SEO value of the product pages? We have several product pages ranking in the SERPs, and I don't know if pushing them one directory further will change that. Thanks for your input!
Reporting & Analytics | | pbhatt0 -
Analytics, Traffic and Rankings. Something is wrong, can you answer it? ;-)
So I've been monitoring analytics to see where our clients are ranking for terms that have brought visitors to the site over the last month to find that the website isnt ranking in the top 100 for that keyword. What are your thoughts on this? Why do you think this could happen? One of the keywords has brough over 700 visitors in the last month yet is not in the top 100 for this term. I've also looked Google Webmaster Tools and have found that the exact same term hasn't had 700 impressions let alone 700 click throughs! Weird! Cheers, Sean
Reporting & Analytics | | 0111001101100100