How To 301 Redirect .html pages
-
I need to redirect a page/URL that is purely .html to a new location. I don't know how to do this. All the redirects I can find are for server side code pages .php/.aspx etc. From my understanding I can't put a server side redirect in a .html file. I am hosting on a microsoft server, however the new page I am redirecting to is .php. I am running some WordPress (.php) files on the server. I need to make it redirect before the old page loads so visitors don't start reading something that is about to get redirected Can someone please help me?
-
Hi again,
A 301 redirect is an instruction given to the server which tells it which page to send the request to.
If you were using an Apache server, you would create a .htaccess file with the lines of code in it to create the redirect.
With a Windows server you should have access to what is effectively a server management console that you can log into. In this console, within the Internet Services Manager, you basically choose the options which create the redirect within the server for you.
It does not matter whether your pages are .html or .php ...the process is the same according to which server setup you are dealing with.
I think perhaps you are confusing a 301 redirect with a redirect script which can be placed in the head of a document. This latter is not a great option for a number of reasons ...most notably that it does not allow link value to flow to the new page and also will not tell the search engine to de-index the old page and replace it with the new.
Hope that helps,
Sha
-
Hi Sha,
Thank you for answering. I actually ran across the example you provided. However that example lists the code to put in various server-side technology pages. For example it lists the script to put in a .php page or a .aspx page. Since my old pages that need to be redirected are .html I didn't think these would work. For example, let say my old page is page.html and I put this 301 redirect script on a page called page.php and upload it to the server. Google will not see page.php and page.html as the same page and therefore will not redirect the right page. This is my understanding please correct me if I am wrong.
PS. I don't understand the directions for the IIS redirect your link mentions. I don't know what it means by "internet services manager", therefore I don't know how to follow its directions. That could be the answer to my problem, I just don't know how to follow it.
Thanks
-
Hi MyNet,
The 301 redirect must be created on the originating server as it needs to intercept the request and send it to the new location.
Since you say that you are hosting on a microsoft server, I am thinking that you need the method for creating a 301 redirect on a IIS server.
You will find these instructions on this quick reference page for creating 301's. This page actually provides instructions and/or code examples for about every situation you could think of...just choose the one you need. (you should check with your ISP to make sure that you know which suits your situation)
Hope that helps,
Sha
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
-
Will URLS With Existing 301 Redirects Be as Powerful As New URLS In Serps?
Most products on our site have redirects to them from years of switching platform and merely trying to get a great and optimised URL for SEO purposes. My question is this: If a product URL has alot of redirects (301's), would it be more beneficial to me to create a duplicated version of the product and start fresh with a new URL? I am not on here trying to gain backlinks but my site is tn nursery dot net (proof:)
Intermediate & Advanced SEO | | tammysons
I need some quality help figuring out what to do.
Tammy0 -
301 redirect recovery
Hello Please understand that English is poor. I used to run a site called A This time, I am running a site called B. I need to set up a temporary 302 redirect from A to B
Intermediate & Advanced SEO | | jinseok
I accidentally set a 301 redirect Site A has many spam links
For now I have removed the 301 redirect source to B. Will A's spam links affect site B?
For your reference, Site B is putting a lot of effort into SEO. Help me.0 -
URL Too Long vs. 301 Redirect
We have a small number of content pages where the urls paths were setup before we started looking really hard at SEO. The paths are longer than recommended (but not super crazy IMHO) and some of the pages get a decent amount of traffic. Moz suggests updating the URLs to make them shorter but I wonder if anyone has experience with the tradeoffs here. Is it better to mark those issues to be ignored and just use good URLs going forward or would you suggest updating the URLs to something shorter and implementing a 301 redirect?
Intermediate & Advanced SEO | | russell_ms0 -
301 redirect to avoid duplicate content penalty
I have two websites with identical content. Haya and ethnic Both websites have similar products. I would like to get rid of ethniccode I have already started to de-index ethniccode. My question is, Will I get any SEO benefit or Will it be harmful if I 301 direct the below only URL’s https://www.ethniccode/salwar-kameez -> https://www.hayacreations/collections/salwar-kameez https://www.ethniccode/salwar-kameez/anarkali-suits - > https://www.hayacreations/collections/anarkali-suits
Intermediate & Advanced SEO | | riyaaaz0 -
Ecommerce catalog update: 301 redirects?
Hello mozers, We run an ecommerce store and are planning a massive catalog update this month. Essentially, 100% of our product listings will be deleted, and an all new catalog will be uploaded. The new catalog contains mostly new products, however there are some products that already existing in the old catalog as well. The new catalog has a bunch of improvements to the product pages, included optimized meta titles and descriptions, multiple language, optimized URLs and more. My question is the following: When we delete the existing catalog, all indexed URLs will return 404 errors. Setting up 301 redirects from old to new products (for products which existing previously) is not feasible given the number of products. Also, many products are simply being remove entirely. So should we go ahead and delete all products, upload the new catalog, update the sitemap, resubmit it for crawling, and live with a bunch of 404 errors until these URLs get dropped from Google? The alternative I see is setting 301 redirects to the home page, but I am not sure this would be correct use of 301 redirects. Thanks for your input.
Intermediate & Advanced SEO | | yacpro130 -
After 301 redirects average rankings went down a little. Any idea?
We have changed the design of a website, from an oscommerce site to a new responsive website with customized programming. After the 301 redirects we have lost 1 to 2 positions in Google Rankings of the most visited categories. This are real data <colgroup><col span="5" width="80"></colgroup>
Intermediate & Advanced SEO | | teconsite
| page | brand | page | CTR | average position |
| old | fagor | http://www.electrorecambio.es/tienda/fagor-m-41.html | 15% | 6,6 |
| new | fagor | http://www.electrorecambio.es/fagor | 13% | 7,2 |
| old | teka | http://www.electrorecambio.es/tienda/teka-m-39.html | 12% | 7,2 |
| new | teka | http://www.electrorecambio.es/teka | 9% | 8,8 |
| old | balay | http://www.electrorecambio.es/tienda/balay-m-81.html | 12% | 7,4 |
| new | balay | http://www.electrorecambio.es/balay | 11% | 8,6 |
| old | bosch | http://www.electrorecambio.es/tienda/bosch-m-44.html | 10% | 7,4 |
| new | bosch | http://www.electrorecambio.es/bosch | 8% | 11 | Edited: As this table is not shown properly I have added an image For you to check the old page you can see the old urls in the folder tienda2. For example http://www.electrorecambio.es/tienda/bosch-m-44.html can be checked in http://www.electrorecambio.es/tienda2/bosch-m-44.html I would like to know if you see any important information that could justify this drop down in rankings Thanks!!! data-webmaster-tools.jpg1 -
Duplicate content reported on WMT for 301 redirected content
We had to 301 redirect a large number of URL's. Not Google WMT is telling me that we are having tons of duplicate page titles. When I looked into the specific URL's I realized that Google is listing an old URL's and the 301 redirected new URL as the source of the duplicate content. I confirmed the 301 redirect by using a server header tool to check the correct implementation of the 301 redirect from the old to the new URL. Question: Why is Google Webmaster Tool reporting duplicated content for these pages?
Intermediate & Advanced SEO | | SEOAccount320 -
Should i continue linking the old page after a redirect 301?
hi everybody, i'm trying to understand why my page http://poltronafraubrescia.zenucchi.it isn't ranked for the keyword poltrona frau brescia even if is indexed on google. the page gets authority and traffic from the page www.zenucchi.it/ITA/poltrona-frau-brescia.html that is already ranked in fourth position for that keyword. should i continue linking the previous or the new page to increase the page authority? i don't know if is a good way to link a page not ranked despite a ranked one.. Please help me.... thanks a lot
Intermediate & Advanced SEO | | guidoboem0