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
-
Is a 404, then a meta refresh 301 to the home page OK for SEO?
Hi Mozzers I have a client that had a lot of soft 404s that we wanted to tidy up. Basically everything was going to the homepage. I recommended they implement proper 404s with a custom 404 page, and 301 any that really should be redirected to another page. What they have actually done is implemented a 404 (without the custom 404 page) and then after a short delay 301 redirected to the homepage. I understand why they want to do this as they don't want to lose the traffic, but is this a problem with SEO and the index? Or will Google treat as a hard 404 anyway? Many thanks
Intermediate & Advanced SEO | | Chammy0 -
Any issue? Redirect 100's of domains into one website's internal pages
Hi all, Imagine if you will I was the owner of many domains, say 100 demographically rich kwd domains & my plan was to redirect these into one website - each into a different relevant subfolder. e.g. www.dewsburytilers..com > www.brandname.com/dewsbury/tilers.html www.hammersmith-tilers.com > www.brandname.com/hammersmith/tilers.html www.tilers-horsforth.com > www.brandname.com/horsforth/tilers.html another hundred or so 301 redirects...the backlinks to these domains were slim but relevant (the majority of the domains do not have any backlinks at all - can anyone see a problem with this practice? If so, what would your recommendations be?
Intermediate & Advanced SEO | | Fergclaw0 -
301 Redirection problems
A couple of days ago we did a restructure of our e-commerce site (wordpress + woocomerce) where some product categories needed to change names. I used Yoast SEO plugin to do 301 redirects in the .htaccess file.Today I noticed that we had two hits in the SERP on the phrase "dildos med vibrator". See the attached screenshot (first two results).One goes to http://www.oliverocheva.se/kategori/sexleksaker/dildos/dildos-med-vibrator/ which is the right URL. One goes to http://www.oliverocheva.se/kategori/sexleksaker/dildosdildos-med-vibrator-dildos-for-honom/ which is a corrupt URL that has never been in use. The old one we did a redirect from was /kategori/for-honom/dildos-for-honom/dildos-med-vibrator-dildos-for-honom/The command in the .htaccess file was: Redirect 301 /kategori/for-honom/dildos-for-honom/dildos-med-vibrator-dildos-for-honom/ http://www.oliverocheva.se/kategori/sexleksaker/dildos/dildos-med-vibratorWhat has happened here? Why does the 301 create entirely new URL:s in the SERP?Tz0TULT.png
Intermediate & Advanced SEO | | kisen0 -
301 Redirect htaccess
Hi Guys, I have a website that has plenty of links with parameters. For example:
Intermediate & Advanced SEO | | UrbanMark
http://www.domainname.co.uk/index.php?app=ecom&ns=catshow&ref=Brandname-Golf-Shorts&sid=201v04gxs2hlozv161tfo43qk98583el I want to place a wildcard redirect on the .htaccess but don't know what exactly code for this. Ideally I want the URLs above to be: http://www.domainname.co.uk/Category/Brandname-Golf-Shorts Any help pls. Thanks,
Brucz0 -
Canonicalization interact with 301 redirects?
This is a interesting one I think. I have recently taken down some product list pages from our website www.towelsrus.co.uk. These have canonicalisation in place to deal with pages where a query string is generated depending on the search criteria. When I put a 301 redirect in place the target page redirects fine, however webmaster tools then errors with 404 on all canonicalised pages. Is this correct behaviour and how do we get over this?
Intermediate & Advanced SEO | | Towelsrus0 -
Very Puzzled --- 301 ReDirects Did Not Work - Lost Rankings - Any Thoughts?
This one has us stumped and frustrated, hopefully someone out there in SEOMoz land can give us some thoughts and/or suggestions on what's going on and how to remedy. This is a follow-up to a post I made awhile back. Here is an excerpt from the original post -- We currently have 3 different versions of our State Business-for-Sale listings pages - the versions are: Version 1 -- Preferred Version (Links on Homepage www.businessbroker.net) http://www.businessbroker.net/State/Vermont-Businesses_For_Sale.aspx Title = Vermont Business for Sale Ads - Vermont Businesses for Sale & Business Brokers - Sell a Business on Business Broker (I realize the title needs work) Version 2: (Links on this page: http://www.businessbroker.net/listings/blistings.ihtml) URL Prior to 301 change --- http://www.businessbroker.net/Businesses_For_Sale-State-Vermont.aspx Title = Vermont Business for Sale | 120 Vermont Businesses for Sale | BusinessBroker.net Version 3: (Links on this page: http://www.businessbroker.net/businessesforsale.ihtml) URL Prior to 301 change --- http://www.businessbroker.net/listings/business_for_sale_vermont.ihtml Title = Vermont Businesses for Sale at BusinessBroker.net - Vermont Business for Sale While the page titles and meta data are a bit different, the bulk of the page content (which is the listings rendered) are identical. OK, so we decided to test this on 5 of our State pages - I will use VERMONT in this discussion. We did 301 ReDirects on Version 2 and Version 3 -- they now redirect to Version 1 - we did the redirects and also changed the URL's on the pages. Prior to the change, we were ranking for keywords like "Vermont Business for Sale" and some other similar keywords -- on 1st page of Google --- now, we have lost our rankings big time. Did we do something wrong? I thought when you did 301's the majority of link juice was supposed to be preserved (losing 10% or so) -- this didn't happen in our case. Any help on what we can do would be appreciated. We only did 5 States as a test and also noticed big drops for Maine as well. These were both states where VERSION 2 was the page that was showing up in SERPs. Thanks in advance for wading through this long post and any help you can provide!! Matt
Intermediate & Advanced SEO | | MWM37720 -
Does 301 Redirect works on social signals?
Hello, I'm considering strategic change in my site's formation.
Intermediate & Advanced SEO | | BeytzNet
301 redirecting some of the pages is not a problem but the question remains - what will happen with all of my social signals? These pages have Likes, plus ones, and tweets. Thanks0 -
Targeting Keywords at Home page or 301 URL?
Background info This is a new site and I am using Wordpress for a CMS not a blog and I have set a static page as the home page. The problem is when I configure the home page as a static page in wordpress it sets a 301 redirect to that page, which is this domain.com/software-consultancy (so the software-consultancy page is now domain.com). I thought about creating a separate Home page but I didn't see the point as the pages would be almost identical. **"Should I target keywords to the home page?" ** If I start link building using the phrase "software consultancy" to the home page should I link to domain.com or the 301 redirect URL domain.com/software-consultancy ? My thoughts are that if the URL has the keywords I am targeting in it will help with SEO. Or should I create a separate home page and just link the company name back to the home and have a separate page for "software consultancy" my thought is that having exactly what the company does on the home page would be better. But I don't want to lose out on search engine traffic by not having the keywords in the URL I am going to be link building for. I guess if I link build to the 301 redirect URL I can always revert back to this URL if I want to change? FYI here is my site structure: The site is for a small software consultancy and I have the following structure: domain.com/software-consultancy -- (Set as Wordpress static Page so essentially a 301 redirect to / ) domain.com/software-consultancy/areas domain.com/software-consultancy/areas/london domain.com/software-consultancy/areas/new-york I would really appreciate some feedback on this, even if it's experience / advice and there is no exact answer. Many Thanks, J
Intermediate & Advanced SEO | | SEOKeith0