301 redirect for ip address in SERPs
-
Hi,
I've recently had the misfortune of my site's ip address being crawled and indexed by Google, which is causing some duplicate content issues. Due to the nature of the site we're not able to implement a canonical tag to fix this at present.
Would a 301 redirect do the trick, and if so, could someone point me to what I'd need to add to our .htaccess file?
Many thanks
Chris
-
Anytime! Let me know how it goes for you.
-
Thanks for your help. I'll give that a go and see what happens!
Cheers,
Chris
-
Here are a few 301 redirects that "might" work on an Apache server
I would always consider saving the original .htacess file
just in case these don’t work for you, as you can always resort back
301 a non-www to your www, as well as redirect your IP address as a 301 to your www.
RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www.domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
For just IP Redirection Use:
RewriteCond %{HTTP_HOST} ^12.34.567.890
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
Don’t forget to fill in the areas with your credentials
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
-
We are redirecting http and non www versions of our website. Should all versions http (non www version and www version) and https (non www version) should just have 1 redirect to the https www version?
We are redirecting http and non www versions of our website. Should all versions http (non www version and www version) and https (non www version) should just have 1 redirect to the https www version? Thant way all forms of the website are pointing to one version?
Intermediate & Advanced SEO | | Caffeine_Marketing0 -
Too many 301 Redirects caused lower rankings :(
1. Ok so I code my eCommerce site myself first 2. Then switched to Shopify and re-direct all my URLs (terrible mistake) 3. Then Shopify didn't do in terms of seo, so I switched to BigCommerce and re-direct all my URLs (Yes I know but at least this platform is much better) I started getting 404 errors as you can imagine in webmaster tools after switching from Shopify and there were 504 of them. Why its too many because I realized that Shopfiy just creates so many urls for the same pages. One by one I re-direct them to their new destinations. As you can imagine my rankings dropped. As my site speed is now 5.5s at gmetrix. mobile 47 - desktop 80 on Google Site speed tool. Looking at the links now, some of the 404's does not make sense to redirect. How should I approach this? Should I remove some of them if they were not used on web anywhere, no sites linking to that page and let them die in time? OR Should I keep them all? I am giving some examples below, there are so many for each. Thank you all! /account/login/ /blog/?page=7 blog/tagged/recipe /blogs/news /blogs/news?page=6 /collections/all/category-name /collections/frontpage/category-name /collections/frontpage/products/product-name /collections/shop/category-name /collections/shop/products/product-name /product-name/ /pages/terms-privacy /pages/frontpage /products/product-name /shop/products/product-name
Intermediate & Advanced SEO | | mounayoga0 -
301 redirects broken - problems - please help!
Hi, I have a bit of an issue... Around a year ago we launched a new company. This company was launched out of a trading style of another company owned by our parent group (the trading style no longer exists). We used a lot of the content from the old trading style website, carefully mapping page-to-page 301 redirects, using the change of address tool in webmaster tools and generally did a good job of it. The reason I know we did a good job is that although we lost some traffic in the month we rebranded, we didn't lose rankings. We have since gained traffic exponentially and have managed to increase our organic traffic by over 200% over the last year. All well and good. However, a mistake has recently occurred whereby the old trading style website domain was deleted from the server for a period of around 2-3 weeks. It has since been reinstated. Since then, although we haven't lost rankings for the keywords we track I can see in webmaster tools that a number of our pages have been deindexed (around 100+). It has been suggested that we put the old homepage back up, and include a link to the XML sitemap to get Google to recrawl the old URLs and reinstate our 301 redirects. I'm OK with this (up to a point - personally I don't think it's an elegant solution) however I always thought you didn't need a link to the xml sitemap from the website and that the crawlers should just find it? Our current plan is not to put the homepage up exactly as it was (I don't believe this would make good business sense given that the company no longer exists), but to make it live with an explanation that the website has moved to a different domain with a big old button pointing to the new site. I'm wondering if we also need a button to the xml sitemap or not? I know I can put a sitemap link in the robots file, but I wonder if that would be enough for Google to find it? Any insights would be greatly appreciated. Thank you, Amelia
Intermediate & Advanced SEO | | CommT0 -
To Redirect or Not
I have a strange situation and looking for advice on how well a permanent redirect of url will work. I have an eCommerce site called twpstain.com. This site sells TWP Deck stain and the URL/Content is fully owned by me. We do not however own the TWP brand and have always operated with permission from the manufacturer as an Authorized dealer. Circumstance have come up where they now want to be in control of all URLS that have the name "TWP" in them. Not sure if they legally can do this but they can cut me off with product if I do not comply. My options are: 1. A permanent redirect of entire site to new URL that does not have the word "TWP" in the url. 2. Give them the URL but they are willing to have me use the URL as I have in the past. A contract for this would be drawn up to cover me for years to come and possibly offer compensation if they decide not to renew. My concerns are numerous but the question for the Moz community is to how well the 301 redirect will work and will I lose my rankings? I currently dominate the rankings for my site and I very concerned that there will be major loss of sales and traffic. Any help or opinions on this would be much appreciated.
Intermediate & Advanced SEO | | dogtopiamichigan0 -
301 redirect for page 2, page 3 etc of an article or feed
Hey guys, We're looking to move a blog feed we have to a new static URL page. We are using 301 redirects but I'm unsure of what to regarding page 2, page 3 etc. of the feed. How do I make sure those urls are being redirected as well? For example: Moving FloridaDentist.com/blog/dental-tips/ to a new page url FloridaDentist.com/dental-tips. So, we are using a 301 on that old url to the new one. My questions is what to do with the other pages like FloridaDentist.com/blog/dental-tips/page/3. How do we make sure that page is also 301'd to the new main url?
Intermediate & Advanced SEO | | RickyShockley0 -
After the 301 redirect
Hi all, A quick question, after you have setup your 301 re-directs in .htaccess - is it necessary to keep your content in the original domains directory? My thinking is that requests do get as far as referencing the directory, thus it should be safe to delete all the files on the old domain? Thanx!
Intermediate & Advanced SEO | | gazza7770 -
Questions about 301 Redirects
I have about 10 - 15 URLs that are redirecting to http://www.domainname.comwww.domainname.com/. (which is an invalid URL)The website is on a Joomla platform. Does anyone know how I can fix this? I can't figure out where the problem is coming from.
Intermediate & Advanced SEO | | JohnParker27920 -
Duplicate titles but redirecting anyway (without redirects set up!!!)
Google has done a crawl of my site and is flagging up duplicate titles on my wordpress site. This appears to be due to the face that some posts are tagged in more than one category. I have just gone to make sure that each post just has one category and add redirects and I've noticed that all the duplicate title issues google has notified me about appear to redirect anyway. For example: http://www.musicliveuk.com/latest-news/live-music-boosts-australian-economy and http://www.musicliveuk.com/live-music/live-music-boosts-australian-economy have duplicate titles apparantly but the 1st url redirects to the 2nd one. I use the redirection plug in but have no redirection set up for that url so I'm a bit confused. And if they're redirecting anyway then why is google flagging up duplicate titles? Any help would be much appreciated.
Intermediate & Advanced SEO | | SamCUK1