Redirects
-
If I redirect page A to page B does page A need to exist before Google sees the redirect. Or can I just put up a redirect and delete page A.
If the page doesn't need to exist: You have all your redirects in place for a website. You want this website to redirect to another website. You completely delete the website and put up the htaccess, there should be no problem with this, because the redirects are in place correct?
Thanks
-
Think of Googlebot like a web user (who happens to be somewhat aimless and browses without JavaScript support).
Googlebot requests a page that it finds by A) following a link on another page, B) following a reference in a sitemap.xml file or C) some other usage data we don't know about (i.e. it scraped the link from a source it doesn't "officially" have access to or users have hit that page frequently with Google toolbar installed, etc).
This is a basic server request for the page. The server gets the message "load this URL" - if there's an .htaccess 301 redirect in place, it does not matter whether the page would ordinarily display content, because the server never gets to that point. It handles the redirect first.
I'm hung up on the second part of your question. "If the page doesn't need to exist...you want this website to redirect to another website." I'm not sure under what circumstances you'd need to do this. If the page doesn't exist, it shouldn't be referenced anywhere on the web, and if it's not referenced anywhere on the web, there's no need for the redirect.
Perhaps you're planning to set up the page as a vanity URL - such as a short URL, for easy reading/remembrance.
In short, for whatever reason you want to achieve this, .htaccess bypasses the need for the first URL to exist - it works on the request for that page, whether the page is there or not, the redirect will bypass it and work properly.
-
To your first question: Redirects are done for pages that presently exist and have been indexed by Google, not for pages that don't presently exist on a website. So if it's a page that has already been indexed by Google, you would implement a 301 redirect to point the old page and most of its link juice to the new page. (Not sure if this answer is what you were after - maybe I don't get the question?)
As to redirecting an old site to a new domain: I suppose you could technically delete the old pages when you put up the htaccess file with the redirects to the new pages. However, I'd strongly caution against doing this in case you need to access the old content for some reason. The crawler won't be able to get at it, because as soon as it hits the server it will trigger the htaccess file which will forcibly send them to the new URLs. I've occasionally had to access an old site's content, so I'm glad I didn't delete it entirely.
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 redirection for e-commerce website
Hi moz community, I am the web agency for a e-commerce website. Its current domain is https://www.liquorland.co.nz but now all the e-commerce part will be moved to a sub-domain https://shop.liquorland.co.nz. There are thousands of e-commerce current being indexed in Google (i.e., 15,500) plus they also have a mobile version of the page like /mobile/default.aspx. Is it necessary to 301 redirect all the pages? We are afraid it may slow down the website because the request will go through thousands of filters. Is it OK to just redirect the main categories? Many thanks in advance.
Technical SEO | | russellbrown0 -
Do you still loose 15% of value of inbound links when you redirect your site from http to https (so all inbound links to http are being redirected to https version)?
I know when you redesign your on website, you loose about 15% internally due to the 301 redirects (see moz article: https://mza.bundledseo.com/blog/accidental-seo-tests-how-301-redirects-are-likely-impacting-your-brand), but I'm wondering if that also applies to value of inbound links when you redirect your http://www.sitename.com to https://www.sitename.com. I appreciate your help!
Technical SEO | | JBMediaGroup0 -
Redirecting a blog
We've acquired another company and want to redirect their soon-to-be-obsolete website to ours. It includes a blog with many blog posts. Should we: only 301 redirect the top level blog URL
Technical SEO | | Caro-O
try redirect individual blogs to blogs of a similar topic on our site (least practical I'm sure)
redirect all their individual posts to our main blog URL Thanks, Caro1 -
Javascript redirects -- what are the SEO pitfalls?
Q: Is it dangerous (SEO fallout) to use javascript redirects? Tech team built a browser side tool for me to easily redirect old/broken links. This is essentially a glorified 400 page -- pops a quick message that the page requested no longer exists and that we're automatically sending you to a page that has the content you are looking. Tech team does not have the bandwidth to handle this via apache and this tool is what they came up with for me to deliver a better customer experience. Back story: very large site and I'm dealing with thousands of pages that could/should/need to be redirected. My issue is incredibly similar to what Rand mentioned way back in a post from 2009: Are 404 Pages Always Bad for SEO? We've also decided to let these pages 404 and monitor for anything that needs an apache redirect. Tool mentioned above was tech's idea to give me "the power" to manage redirects. What do you think?
Technical SEO | | FR1230 -
Redirects for new website
Hi Moz community,
Technical SEO | | JSimmons17
I'm a fairly new SEO Specialist with a brand new website. We initially had a very basic holding website until the fully functional website was completed. I have to do some redirects as we have both .html and .php files & we don't want to lose SEO value for specific pages (like the index, news, etc). I also want to redirect from a www url to a non-www url. I am trying to accomplish redirects with the following code: RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mywebsite.com [NC]
RewriteRule (.*) http://mywebsite.com/$1 [R=301,L] RedirectMatch 301 /index.html (.*).(php|html) http://mywebsite.com/index.php RedirectMatch 301 /cupcakes-slideshow/glutenfree-slideshow.html (.*).(php|html) http://mywebsite.com/gluten-and-glutenfree.php RedirectMatch 301 /press.html (.*).(php|html) http://mywebsite.com/news-and-reviews.php Please let me know if I am on the right track. Thanks so much in advance!0 -
Help with 301 redirect code
Hi, I can't work out how to make this one work and would apreciate if someone could help.
Technical SEO | | Paul_MC
i have a series of folders from a old site that are in the structure:
/c/123456/bags.html (the "123456" changes and is any series of 6 digit numbers), and the "bags.html" changes depending on the product.
I need that to be 301 redirected to the following format:
/default/bags/bags.html0 -
Delete 301 redirected pages from server after redirect is in place?
Should I remove the redirected old pages from my site after the redirects are in place? Google is hating the redirects and we have tanked. I did over 50 redirects this week, consolidating content and making one great page our of 3-10 pages with very little content per page. But the old pages are still visible to google's bot. Also, I have not put a rel canonical to itself on the new pages. Is that necessary? Thanks! Jean
Technical SEO | | JeanYates0 -
How to Redirect only specific pages to new domain
My HTACCESS FILE IS AS FOLLOWS: rewriteengine on
Technical SEO | | askthetrainer
rewritecond %{HTTP_HOST} ^mydomain.com$
rewriterule ^mydomain/(.*)$ "http://www.mydomain.com/$1" [R=301,L] #4d864805b49b5 I want to move ONLY specific pages from this domain to a new domain How do I edit my HTACCESS (which redirects http:// to www.) to move specific pages from old domain (which I have to delete) to new domain.... I.e. http://mydomaon.com/move.html needs to move to http://mynewdomain.com/move.html Where i can delete the original domains0