Redirect a temporary IP
-
I was performing some development work on a client's site recently under a temporary location on the host's server, for example:
Google managed to index a couple of pages using this url
I have updated DNS to the correct domain and the site is live, but I am a bit confused in regards to the correct way to create a 301 Redirect for this example or at least a way point it to our 404 page.
I am hoping someone more proficient with htaccess can help me out a bit...
Thanks!
-
Ah, simple, nice work!
-
It was not a "test" server; rather, a temporary url (prior to updating DNS) to the actual client account on the host server. All development pages were deleted, which is why I was looking for a method to accomplish this via htaccess, but it's not looking promising...
UPDATE
I discovered I only needed to remove the numerical portion of the IP address and then form like a normal 301 Redirect.
Example:
Redirect 301 /~accountname/folder/page.html /folder/page/html
As usual, I was over-complicating things
Hope this helps someone. And, thanks for your suggestions Aran.
-
Hi,
On the page (on the test server), you could use the following code (assuming your using PHP).
**header("HTTP/1.1 301 Moved Permanently");
header("Location: client-site.com/new-page-name.html**");**
?>
Hope that helps**
-
Sure! I would like to redirect the temporary url Google indexed (with the server IP in it above) to the correct page name on the now live domain.
For example: client-site.com/new-page-name.html
I am quite familiar with 301's which direct to a new page location/name - however, the IP address and the fact that it's not actually a domain is tripping me up a bit.
Thanks!
-
hi Could you elaborate and explain what is is your want to achieve with the redirect?
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
-
Htaccess - Redirecting TAG or Category pages
Hello Fellow Moz's, We have an issue redirecting some /TAG and /Category pages to inner pages. As an example we use: RedirectMatch 301 /category/Sample-Category(.*) https://OurDomain.com.au/New-Page//$1 That works well. The issue is we have other categories and tags that are named similar to /Sample-Category As an example, if we try to redirect /Sample-Category-1 to /New-Page-1 - it will not work, and redirects to /New-Page I assume this is because /Sample-Category is already being redirected, so anything after /Sample-Category like -1 or -2 or -3 etc, will not be recognized. Anyone know of a workaround?
Intermediate & Advanced SEO | | Jes-Extender-Australia0 -
301 redirects
One of our employees took an SEO class recently. She was told that having too many 301 redirects can hurt SEO. I have never heard of 301 redirects as having a negative impact. Any thoughts?
Intermediate & Advanced SEO | | Smart_Start0 -
Robots.txt and redirected backlinks
Hey there, since a client's global website has a very complex structure which lead to big duplicate content problems, we decided to disallow crawler access and instead allow access to only a few relevant subdirectories. While indexing has improved since this I was wondering if we might have cut off link juice. Since several backlinks point to the disallowed root directory and are from there redirected (301) to the allowed directory I was wondering if this could cause any problems? Example: If there is a backlink pointing to example.com (disallowed in robots.txt) and is redirected from there to example.com/uk/en (allowed in robots.txt). Would this cut off the link juice? Thanks a lot for your thoughts on this. Regards, Jochen
Intermediate & Advanced SEO | | Online-Marketing-Guy0 -
Domain forward or 301 redirect
My company recently acquired another company including their web presence. We are soon ending their website and will be either 301 redirecting their domain to our domain or pointing their domain to our nameservers. Their domain authority is only 25 while our domain authority is 32. Their domain was created in 1998 while ours was created in 1999. So to keep our domain authority up or enhance it, should we do a 301 redirect or a domain forward. And that is if there is any difference? Thanks Chris
Intermediate & Advanced SEO | | topsailislander0 -
Which automatic redirects to use in International SEO
Hi, I need help with international SEO redirects. I'm going to have intelligencebank.com/au for Australian visitors and intelligencebank.com for the rest of the world. I would like to automatically redirect aus users that land on .com to .com/au and vice versa for non-australian users. 1. Which automatic redirects should I use: a) java script because it will allow US based google bots to crawl my /au website (bots won't read javascript so they won't be redirected) b) http redirects c) 301 redirects d) 302 redirects e) anything else? a) Should I still use rel alternate even though I only use english? b) if I should add rel alternate, can I still keep my existing rel canonical tags that are use to avoid duplicate content (I use a lot of utm codes when advertising)
Intermediate & Advanced SEO | | intelligencebank0 -
Buying a domain and redirecting it to your website (improves seo?)
hello everyone, imagine that I have a website with Pagerank 7, PA50 DA59... and there is another website who is my competitor... so I decide to buy them... Pagerank3 PA30, DA25.. So I redirect this website to my domain...Using google webmasters I say to Google that it was redirected... So does this improve my SEO or no? Do I get part of the link juice and so on? Can this really improve my rankings?
Intermediate & Advanced SEO | | FCRMediaLietuva0 -
301 - should I redirect entire domain or page for page?
Hi, We recently enabled a 301 on our domain from our old website to our new website. On the advice of fellow mozzer's we copied the old site exactly to the new domain, then did the 301 so that the sites are identical. Question is, should we be doing the 301 as a whole domain redirect, i.e. www.oldsite.com is now > www.newsite.com, or individually setting each page, i.e. www.oldsite.com/page1 is now www.newsite.com/page1 etc for each page in our site? Remembering that both old and new sites (for now) are identical copies. Also we set the 301 about 5 days ago and have verified its working but haven't seen a single change in rank either from the old site or new - is this because Google hasn't likely re-indexed yet? Thanks, Anthony
Intermediate & Advanced SEO | | Grenadi0