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
-
301 Redirect from query string to new static page
If i want to create a redirect from a page where the slug ends like this "/?i=4839&mid=1000&id=41537" to a static, more SEO friendly slug like "/contact-us/", will a standard 301 redirect suffice? Thanks, Nails
Intermediate & Advanced SEO | | matt.nails0 -
301 Redirecting from domain to subdomain
We're taking on a redesign of our corporate site on our main domain. We also have a number of well established, product based subdomains. There are a number of content pages that currently live on the corporate site that rank well, and bring in a great deal of traffic, though we are considering placing 301 redirects in place to point that traffic to the appropriate pages on the subdomains. If redirected correctly, can we expect the SEO value of the content pages currently living on the corporate site to transfer to the subdomains, or will we be negatively impacting our SEO by transferring this content from one domain to multiple subdomains?
Intermediate & Advanced SEO | | Chris81980 -
Can I undo a 301 redirect? Will it penalize my ranking?
I'm in charge of building a website for a company that made a mess. They own domain xxx.it (xxx is not the real domain, just a placeholder). Some years ago they 301 redirected xxx.it to xxx.com (they just changed TLDs). Last year they 301 redirected xxx.com to yyy.com (so, they actually changed domains). Now, after 13 months, the company failed and the new leadership wants me to undo everything and 301 redirect from yyy.com to xxx.it. So: 301 redirect is permanent. So, conceptually it's wrong to undo it. What happens if I undo it? Will my ranking be penalized, even if a significant amount of time has passed (13 months)? Will crawlers detect a loop (even if i remove any 301 redirect from xxx.it and theorically break the loop)? Here is the potential loop: xxx.it -> xxx.com -> yyy.com -> xxx.it -> etc... All of the articles I found on the web are quite old and not clear about this topic, that's why I'm asking this question.
Intermediate & Advanced SEO | | naska19900 -
301 Redirect from ASP.NET to PHP...Is it possible?
Hi all, I'm trying to migrate my current website over to wordpress however my current website is ASP.NET and obviously Wordpress uses PHP. Is it possible to perform a 301 redirect from a asp.net to a php? Or do you need to convert the asp.net language into php? Or something different? I welcome your thoughts? Regards, Thomas Rochford
Intermediate & Advanced SEO | | CoGri0 -
Can an incorrect 301 redirect or .htaccess code cause 500 errors?
Google Webmaster Tools is showing the following message: _Googlebot couldn't access the contents of this URL because the server had an internal error when trying to process the request. These errors tend to be with the server itself, not with the request. _ Before I contact the person who manages the server and hosting (essentially asking if the error is on his end) is there a chance I could have created an issue with an incorrect 301 redirect or other code added to .htaccess incorrectly? Here is the 301 redirect code I am using in .htaccess: RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/.]+/)*(index.html|default.asp)\ HTTP/ RewriteRule ^(([^/.]+/)*)(index|default) http://www.example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(www.example.com)?$ [NC] RewriteRule (.*) http://www.example.com/$1 [R=301,L] Could adding the following code after that in the .htaccess potentially cause any issues? BEGIN EXPIRES <ifmodule mod_expires.c="">ExpiresActive On
Intermediate & Advanced SEO | | kimmiedawn
ExpiresDefault "access plus 10 days"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/plain "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-icon "access plus 1 year"</ifmodule> END EXPIRES (Edit) I'd like to add that there is a Wordpress blog on the site too at www.example.com/blog with the following code in it's .htaccess: BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /blog/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]</ifmodule> END WordPress Thanks0 -
IP Address: Ownership Location Versus IP Resolve
We are a US based ecommerce company that recently switched hosting to a Canadian owned company. I was told we would have a US based IP address but noticed yesterday that the MOZ bar is listing my website, 1800doorbell.com as a Canadian company. I've researched this online and what's typically stated is that your IP location needs to be in the Geo area you serve. When I brought his up to my host they stated: "The location being reported by many of these tools will be the one from the WHOIS. Since our corporation is registered in Canada, it will return a matching result. You can verify the location of the address by issuing a traceroute and examining the location codes at the end of the traceroute. For example, on: 96.125.180.207" So now I am really confused. What matters to me is how the search engines see my IP address. Will/do they see it as a US IP address? Below is the output from DNSstuff and thanks for any help: This is what I received back from DNSstuff: | ASN | 12179 |
Intermediate & Advanced SEO | | jake372
| Name | INTERNAP-2BLK |
| Description | - Internap Network Services Corporation |
| # Peers | 11 |
| # IPv4 Origin Ranges | 32 |
| # IPv6 Origin Ranges | 2 |
| Registrar | ARIN |
| Allocation date | Apr 13, 1999 |
| Country Code | US | | |
| Reverse | unknown.static.dal01.cologlobal.com. |
| Reverse-verified | No |
| Origin AS | - Internap Network S... |
| Country Code | CA |
| Country | Canada |
| Region | North America |
| Population | 31592805 |
| Top-level Domain | CA |
| IPv4 Ranges | 5944 |
| IPv6 Ranges | 336 |
| Currency | Canadian Dollar |
| Currency Code | CAD |
| IP Range - Start | 96.125.176.0 |
| IP Range - End | 96.125.191.255 |
| Registrar | ARIN |
| Allocation date | May 10, 2011 |0 -
Effect SERP's internal 301 redirects?
I'm considering installing Wordpress for my website. So I have to change the static URL's from /webpage.html to /webpage/. Yet I don't want to lose in the SERP's. What should I expect?
Intermediate & Advanced SEO | | wellnesswooz1 -
301 or 404?
My client has a classified ads website with hundreds of thousands of classified ads. These ads expire quite fast. When the ad expires it gets removed. At the moment this results in a 404 page and thus hundreds of thousands of 404 erros in Webmasters Tools. From what I know this damages SERP results due to slow indexing of important sites and 404 being just plain bad SEO. I suggested doing a 301 from the expired ads to a upper category but this feels like cheating. The content hasn't actually moved, it has been removed. What would you suggest?
Intermediate & Advanced SEO | | PanuKuuluvainen0