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
-
How to handle individual page redirects on Wix?
I switched from one domain to another because I wanted a domain that had our company name so it was more brand-y. However, the old domain had better DA/PA. Originally I set up a global 301 from the old to the new, but now I'm finding that I actually need to set up individual 301's from each URL of the old site, or at least from each page. However, I am using Wix so it looks like I can't always do URL-URL 301's, although I can redirect any URL to a page on the new website. The problem is that, in some cases, the content on the new site is different (or, for example, I can only link a particular blog post on the old site back to the new site's blog's main page). How closely do URLS/pages need to resemble each other for link juice to be transferred? Also, should I try to set up all these redirects manually or bite the bullet and go back to using the old domain? The problem is that I did a lot of beginner SEO junk for the new domain, like submitting to a few higher-quality directories, and getting our website on various industry resource sites, etc. I'd need to re-do this entirely if I go back to the old page. What do you think?
Intermediate & Advanced SEO | | BohmKalish1230 -
Multiple 301 redirects and old site content appearing in Google results
I have found that for some Google searches the old version of the site on a completely different domain is appearing on page one of the results, while the newer site is only on page 3. The old site is redirecting to the new site with a 301 redirect, however there is also an additional redirect on the new site to force SSL. Despite this when you view the Google cache of the result that appears in Google the content of the page is still the old site. Is this normal or is Google not following the chain of 301 redirects? Edit: I just found out that downloading the page by right clicking a link and clicking download rather than viewing it in a browser leads to the old site appearing and the 301 redirect not being followed.
Intermediate & Advanced SEO | | freshleafmedia0 -
Effect Of Restoring Old Website After Implementing 301 Redirects
After redesigning my old Drupal website and launching a new "improved" Wordpress version the new version is performing badly. Ranking is poor and conversions don't occur. I realize that my new design is bad (no call to action, poor structure, text heavy). New business inquiries have ceased. The site contains 450 pages. After spending $25,000 and a year of my life I see the new version is not an improvement! What would be the effect of reinstating the old version of the site and doing 301 redirects back to it? Would the old rankings be restored? I need to decide whether I should revert or focus on fixing flaws in the improved design. Any thoughts?? Thanks,
Intermediate & Advanced SEO | | Kingalan1
Alan0 -
Redirecting a redirect - thoughts?
Hi! A client has just had 14k 404s pop up in his WMT. I think this is because a page that they redirected to had moved. My question is, can I clean these up by redirecting the page the original redirect was one? If so, will it have any negative impact?
Intermediate & Advanced SEO | | neooptic0 -
301 redirect a old site that has been "dead" for a while?
Hi guys, A quick question. I have a client who has an old business website that had some great links (Forbes.com, CocaCola.com, etc). The problem is that he knew nothing about SEO and let the hosting expire. He still owns the domain, but the site is no longer listed in Google. He did no SEO, so I am not worried about being hit by any artificial anchor text penalties, since the links are as natural as it gets. So my questions is, would there be any benefit from 301 redirecting that site to his new business? The new business is in almost exactly the same niche as the old site. I am thinking of 301'ing to a sub-page which will refer to his past venture with the old business, not to the homepage of the new site. Thanks in advance for your help.
Intermediate & Advanced SEO | | rayvensoft0 -
Restructuring/Removing 301 Redirects Due To Newly Optimized Keywords
Just to be clear, this is for one unique page on a website. Also, please see my diagram attached. Let's say that a page's URL was originally /original. So, you optimize the page for a new keyword (keyword 1), and therefore change the URL to /keyword-1. A 301 redirect would then be placed... /original > /keyword-1 However, let's say 6 months down the road you realize that the keyword you optimized the page for (keyword 1) just isn't working. You research for a new keyword, and come up with (keyword 2). So, you'd like to rename the page's URL to /keyword-2. After placing a redirect from the current page (keyword 1) to the 'now' new page (keyword 2), it would look like this... /original > /keyword-1 > /keyword-2 We know that making a server go through more than one redirect slows the server load time, and even more 'link-juice' is lost in translation. Because of this, would it make sense to remove the original redirect and instead place redirects like this? /original > /keyword-2 /keyword-1 > /keyword-2 To me, this would make the most sense for preserving SEO. However, I've read that removing 301 redirects can cause user issues due to browsers caching the now 'removed' redirect. Even if this is ideal for SEO, could it be more work than it's worth? Does anyone have any experience/input on this? If so, I greatly appreciate your time! oDvLl.jpg
Intermediate & Advanced SEO | | LogicalMediaGroup1 -
How to do a 301 redirect for url's with this structure?
In an effort to clean up my url's I'm trying to shorten them by using a 301 redirect in my .htaccess file. How would I set up a rule to grab all urls with a specific structure to a new shorter url examples: http://www.yakangler.com/articles/reviews/other-reviews/item/article-title http://www.yakangler.com/reviews/article-title So in the example above dynamically redirect all url's with /articles/reviews/other-reviews/item/ in it to /reviews/ so http://www.yakangler.com/articles/reviews/boat-reviews/item/1550-review-nucanoe-frontier http://www.yakangler.com/articles/reviews/other-reviews/item/1551-review-spyderco-salt http://www.yakangler.com/articles/reviews/fishing-gear-reviews/item/1524-slayer-inc-sinister-swim-tail would be... http://www.yakangler.com/reviews/1550-review-nucanoe-frontier http://www.yakangler.com/reviews/1551-review-spyderco-salt http://www.yakangler.com/reviews/1524-slayer-inc-sinister-swim-tail with one 301 redirect rule in my .htaccess file.
Intermediate & Advanced SEO | | mr_w0 -
What redirect code (301,302,303) should I use for pages that are available only for logged in users?
If for example they go to a page like /premium-content, they will be automatically redirected (302) to the login page. Because now I do a 302 redirect, in Google Webmaster Tools it sais I have duplicate title issues for each of the pages that are accessible only for the logged in users. If I would do a 301 redirect, I basically tell Google that those pages are moved, but it is not the case because logged in users will see those pages.
Intermediate & Advanced SEO | | STEFANOAGBAGLA0