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
-
301 redirecting a site that currently links to the target site
I have a personal blog that has a good amount of back links pointing at it from high quality relevant authoritative sites in my niche. I also run a company in the same niche. I link to a page on the company site from the personal blog article that has bunch of relevant links pointing at it (as it's highly relevant to the content on the personal blog). Overview: Relevant personal blog post has a bunch of relevant external links pointing at it (completely organic). Relevant personal blog post then links (externally) to relevant company site page and is helping that page rank. Question: If I do the work to 301 the personal blog to the company site, and then link internally from the blog page to the other relevant company page, will this kill that back link or will the internal link help as much as the current external link does currently? **For clarity: ** External sites => External blog => External link to company page VS External sites => External blog 301 => Blog page (now on company blog) => Internal link to target page I would love to hear from anyone that has performed this in the past 🙂
Intermediate & Advanced SEO | | Keyword_NotProvided0 -
301 migration - Indexed Pages rising on old site
Hello, We did a 301 redirect from site a to site b back in March. I would check on a daily basis on the index count using query "site:sitename" The past couple of days, the old domain (that was 301 redirected) indexed pages has been rising which is really concerning. We did a 301 redirect back in march 2016, and the indexed count went from 400k pages down to 78k. However, the past 3 days it went from 78k to 89,500. And I'm worried that the number is going to continue to rise. My question - What would you do to investigate / how to investigate this issue? Would it be screaming frog and look at redirects? Or is this a unique scenario that I'd have to do other steps/procedures?
Intermediate & Advanced SEO | | ggpaul5620 -
New Site (redesign) Launched Without 301 Redirects to New Pages - Too Late to Add Redirects?
We recently launched a redesign/redevelopment of a site but failed to put 301 redirects in place for the old URL's. It's been about 2 months. Is it too late to even bother worrying about it at this point? The site has seen a notable decrease in site traffic/visits, perhaps due to this issue. I assume that once the search engines get an error on a URL, it will remove it from displaying in search results after a period of time. I'm just not sure if they will try to re-crawl those old URLs at some point and if so, it may be worth it to have those 301 redirects in place. Thank you.
Intermediate & Advanced SEO | | BrandBuilder0 -
Pages that 301 redirect to a 404
We are going through a website redesign that involves changing URL's for the pages on our site. Currently all our pages are in the format domain.com/example.html and we are moving to stip off the .html file extension so it would just be domain.com/example We have thousands of pages as the site deals with news so building a redirect for each individual page isn't really feasible. My plan is to have a generic rewrite rule that redirects any page that ends .html to the stripped off version of this. A problem I can see with this is that it will also redirect pages that don't exist. So for example, domain.com/non-existant-page.html would 301 to domain.com/non-existant-page which would then return a 404 status. What would the SEO repercussions be for this? Obviously if a page doesn't exist already then it shouldn't show up in the search engine indexes and shouldn't be a problem but I'm a bit worried about how old pages that currently legitimately 404 will be treated when they start to 301 redirect to a 404 instead. Not sure if there any other potential issues from this that I've missed either? Thanks!
Intermediate & Advanced SEO | | sbb0240 -
Penalty after 301 redirect?
We run a training center. We had 1 main website and 2 dedicated websites to certain themes. The 2 dedicated websites are older and the main website is about 6 months old. The 2 dedicated websites had a top 5 ranking for their most important keywords. 2 weeks ago we imported all the content from the dedicated websites into the main website. Then immediately after we did a perfect 301 redirect of these websites to the main website. 2 SEO companies checked it for us and so I'm very sure this is done right. Google immediately caught this up and gave the main website a boost. We where in the top 10 for many important keywords for 1 week. The next week all our rankings dropped. We only have a top 50 ranking for 10 keywords. Before it was 75 keywords in the top 20. Do you know what could have caused this? Any suggestion, thought, ... is welcome!
Intermediate & Advanced SEO | | wellnesswooz0 -
301 redirects
Hello, I want to ditch about 1000 pages of a 2000+ page site. I believe the 301 redirect thing is the way to go but my expertise is limited. Is there a way to do a blanket redirect ie if a user or search engine looks for a page thats not there it all gets redirected to the index page or do I have to do each one manually? Thanks Ian
Intermediate & Advanced SEO | | jwdl0 -
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 -
301 Redirect question
Which is the best way to set up the 301 redirect on my main home page? http://horsebuggy.com to http://www.horsebuggy.com Or does it make a difference? Boodreaux
Intermediate & Advanced SEO | | Boodreaux0