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.
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
-
Redirection chain and Javascript Redirect
Hi, A redirection chain is usually defined as a page redirecting to another page which itself is another redirection. URL1 ---(301/302)---> URL2 ---(301/302)---> URL3 But what about Javascript redirect? They seem to be a different beast: URL1 ---(301/302)---> URL2 ---(200 then Javascript redirect)---> URL3 From what I know if the javascript redirect is instant Google counts it as a 301 permanent redirection, but I'm still not sure about if this counts as a redirection chain. Most of the tools (such as moz) only see the first redirection. So is that scenario a redirection chain or no?
Technical SEO | | LouisPortier0 -
Redirects
Hello, i would like to ask which is the best redirect to use in a website now i have all my links to go to https://www.anavasis.gr Which is the best between: https://www.anavasis.gr https://anavasis.gr https://www.anavasis.gr/index.php https://anavasis.gr/index.php thanks in advance
Technical SEO | | anavasis0 -
CGI Redirects
Trying to 301 old legacy files like oldsite.com/green/red.cgi/blue/ using this htaccess code: Redirect 301 /green/red.cgi/blue/ http://www.newsite.com/summary-page/
Technical SEO | | SoulSurfer8
Instead it's redirecting to: newsite.com/red.cgi/blue/ FYI oldsite.com's htaccess file does not have any global 301 rules that would conflict Does anyone know if cgi files require a different 301 syntax? Thanks!0 -
301 redirects
Hello. Our site was recently rebuilt, and we switched from using index.php in all the urls to not using it at all. We also changed the names of many of our pages. So the urls have been renamed from "example.com/index.php/old_page_name/" to "example.com/new-page-name/". While we were at it, we changed from "_" to "-" as our word separators in the urls. In the .htaccess file, we have a small block of code that strips out "index.php/" from all requests. This code redirects a request for "example.com/index.php/old_page_name/" to "example.com/old_page_name/" For your information, the code that strips out "index.php/" is: RewriteCond %{THE_REQUEST} ^GET.index.php [NC]
Technical SEO | | nyc-seo
RewriteCond %{THE_REQUEST} !/uSZWTLna/.
RewriteRule (.?)index.php/(.*) /$1$2 [R=301,L] Then we have 301 redirects from "example.com/old_page_name/" to "example.com/new-page-name/" QUESTION 1: Is this two-step redirect approach okay, or would it be better to skip the separate index.php stripping code and simply have 301 redirects that include "index.php" in the urls? QUESTION 2: Will we lose some of the benefit of the links that have to pass through a 301 redirect? QUESTION 3: We have 50 or so redirects. Will this affect performance of the site? How many redirects does it take to start affecting performance? Thank you!0 -
Holy Redirects
Currently working on a project for a medium sized site (http://sleeponcall.com/) but the SEOMoz crawl crawled over 14,000 pages because the report is showing more than 8,000 redirects. The client has no clue how this happened as their previous web programmers may not have been on the ball. What could be causing the problem and what is the best way to untangle this mess?
Technical SEO | | Nobody15330770827560 -
Redirection Plugin and Regular Expressions
I am using Wordpress and the Redirection plugin. I have recently launched a new site and while it was in development, a lot of broken pages were created and indexed. These are terminating in 404s. I am looking to redirect all traffic from: /replay/postname/ to the homepage. When I use this regular expression: Source: /replay/* Target: / it removes the /replay/ but leaves the postname. Any idea how I could redirect all traffic inside of /replay/ to the homepage? Thanks a bunch, Josh
Technical SEO | | dreadmichael0 -
Redirects 301
Hello, I need to reedirect a URL of a page that I have in my site (http://digitaldiscovery.com.pt/servicos-de-marketing-digital/publicidade-online/) to a new URL with SEO porpuses. Whats the best way to this? I use Wordpress btw. Tks in advance! PP
Technical SEO | | PedroM0 -
Redirecting an Old Domain
One of my clients has a newish e-commerce website that was just redesigned. Part of this new marketing push is shutting down an old yahoo store. The problem is that this old store's domain has a 10 year old link in DMoz and is there fore in about 200 other directories. Is pointing that old domain at the new website going to be enough to keep all of that link juice flowing?
Technical SEO | | Simple_Machines0