New "Static" Site with 302s
-
Hey all,
Came across a bit of an interesting challenge recently, one that I was hoping some of you might have had experience with!
We're currently in the process of a website rebuild, for which I'm really excited. The new site is using Markdown to create an entirely static site. Load-times are fantastic, and the code is clean. Life is good, apart from the 302s.
One of the weird quirks I've realized is that with oldschool, non-server-generated page content is that every page of the site is an Index.html file in a directory. The resulting in a www.website.com/page-title will 302 to www.website.com/page-title/.
My solution off the bat has been to just be super diligent and try to stay on top of the link profile and send lots of helpful emails to the staff reminding them about how to build links, but I know that even the best laid plans often fail.
Has anyone had a similar challenge with a static site and found a way to overcome it?
-
Wow. I wasn't expecting such a detailed and awesome answer Danny. Thanks so much, I'm in the process of migrating away from S3 anyways (for other reasons) though you're right in that I'm going to miss the cost & load times.
I'm using Middleman for now, though the technical part of my brain is indeed interested in how you're going to accomplish the Jekyll solution. I'll look out for your post!
And thanks for the tip on my site. Another thing to add to the list
Arun
-
Hey Arun,
Thanks for posting! I was beginning to think that I was the only Inbound guy anywhere that had to deal with this kind of issue
Yup, I created the same bug with redirect loops trying to get around the slash issue. The problem is that S3 doesn't consider the slash as part of the rewrite data unless something comes after it.
Ultimately, my number one suggestion would be to go with a different service that allows you to install a Server App like Nginx or Apache. Others have agreed that redirections set up through a server app are the way that they feel the most comfortable that link equity is being passed.
If you're dead-set on S3, which I would understand as the load times are crazy-awesome-insane, I may have a solution for you soon. Our dev team is working on a script for Jekyll + S3 sites that will essentially create extension-less files (i.e. example.com/contact) that contain meta refresh + rel canon.
The script will use a list of desired redirections + rules that is structured the same way an htaccess file would be. I can't speak to how it will get past S3's default 302ing yet, but I know that it will use CURL. Look for a YouMoz post soon from me!
Anyways, I hope my notes here help! I'm gonna try and make that post soon after the script is created. Just as a last note, in taking a look at your site I noticed that a lot of the internal links on your homepage don't have the trailing slash in them. I would definitely start there and add those slashes, and perform a "submit page + linked page" to Webmaster Tools after!
-
Hi Danny-
I've got the exact same issue (static site on S3 redirecting with 302s), and surprisingly can't find a lot of information out there. If I do a S3 metadata based redirect from (for example) /blog to /blog/ I just end up in a redirect loop.
I checked out your site and it still looks like you're working on it. Did you end up figuring anything out? If there's any way that I can help get to a solution I'd be happy to spend some time on it.
Thanks!
Arun
-
Thanks for the reply David!
Yup, I think that this has just been a case of wrapping my head around a new way of doing things (i.e. redirections in the AWS bucket config rather than using .htdocs). Static sites are a crazy combination of complicated and simple!
Thanks! We're using Jekyll somewhat, although we've had issues with the image hosting. I've actually had better results using the local github client + "Mou", a local Markdown editor.
-
Nice! (for speed at least)
I would show your team some examples of external URLs pointing at the non trailing slash versions of your pages and explain the downside of the 302 redirect. Also consider that people and bots visiting those URLs will be adding overhead to your server, and on Amazon that will equal increased cost (small as it may be, the pennies add up!)
Reading the link you provided it looks like the default behaviour of the page metadata redirect under the s3 console is to create a 301 redirect. That makes me think the 302 is coming from somewhere else. Look at the following URL:
http://docs.aws.amazon.com/AmazonS3/latest/dev/HowDoIWebsiteConfiguration.html
It looks like you can add advanced redirects under "Enable website hosting -> edit redirection rules". I'd explore if there are redirects listed there and maybe chat to your developers further.
While you are it I spotted two other issues for you to consider. Currently the index.html files in your directories resolve to the same page as your main directory. I would 301 those pages back to the parent directory (slash version). Or you could add canonical URLs pointing back to the parent directory (with trailing slash). I'd make a case for adding canonical URLs to all pages.
Also, you currently have a number of redirect chains e.g.
http://www.strutta.com/resources/posts/share-your-contests-and-sweepstakes-all-over-social-media 301 redirects to http://www.strutta.com/resources which 302 redirects to http://www.strutta.com/resources/.
You need to find the original redirect and change it to 301 redirect to the trailing slash version of the directory. Screaming Frog can help you find these redirect chains.
-
Hi Danny!
I don't have much to add here, I think the guys have it right in that you'll need to figure out how to make the 301 work. I quickly read that documentation, then realized I wasn't a robot, so I found this: http://aws.typepad.com/aws/2012/10/amazon-s3-support-for-website-redirects.html which was a bit more friendly.
I wish I could help you out more, but I'm not using AWS. I'm assuming you'll be able to use wildcard or regex matching somewhere, and that should solve your problem.
Great site by the way, anything you're using to help out with the static blog? (Jekyll, Octopress?)
-
Follow-up answer:
Our new website (Strutta.com) is entirely static, hosted on S3. No Apache, just straight HTML files. No apache means no htaccess.
Instead of using htaccess, we have to use the S3 Console: http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
As far as I can tell, this sets up redirects the same way. Although this doesn't answer my initial question, I'm going to try using the control panel later on today to see if 301ing the directories there to include the / will get recognized before whatever is causing the 302 currently
-
Thanks all,
I think the problem is coming from the fact that we're hosted on Amazon Webservices, and the devs are using the "aws bucket config" settings to institute redirects instead of htaccess. SEO vs Dev Battle time.
-
Hey Danny,
As Maximilian suggested above the best solution is going to be to change those 302s to 301s. I generally like to redirect to trailing slash URLs for directories and non trailing slash URLs for files/pages (that's that standard convention). I find in practice hardly anyone who links organically ever includes a trailing slash when linking to a page, but when it's the homepage I don't worry about it too much, browsers and Google can figure that out.
Basically you need to figure out where the 302 is coming from and hopefully it is in your .htaccess file. If you can edit your .htaccess file you need to change that to a 301 redirect, or you could remove the redirect and just use a canonical URL pointing at the / version of the page. I would prefer to go with the 301 though. Just be sure to look at how these redirects are being implemented and in what order, you don't want to end up with redirect chains either.
Can you get access to your .htaccess file or is the server running something funky?
-
Perhaps this is too obvious, but can you not change the 302 to 301's?
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
-
Main Site and eCommerce Site URLs for SEO
My client currently has a main website on a url and an eCommerce site on a subdomain. The eCommerce site is currently not mobile friendly, has images that are too small and are problematic - and I believe it negates some of the SEO work we do for them. I had to turn off Google Shopping ads because the quality score was so low. That being said, they are rebuilding a shopping cart on a new platform that will be mobile friendly BUT the images are going to be tiny until they slowly replace images over several months. Would you keep the shopping cart on a subdomain, or make it part of the main website URL? Can it negatively impact the progress we have made on the main site SEO.
Technical SEO | | jerrico10 -
Site hacked in Jan. Redeveloped new site. Still not ranking. Should we change domain?
Our top ranking site in the UK was hacked at the end of 2014. http://www.ultimatefloorsanding.co.uk/ The site was the subject of a manual spam action from Google. After several unsuccessful attempts to clean it up, using Securi.net and reinstating old versions of the site, changing passwords etc. we took the decision to redevelop the site. We also changed hosting provider as we had received absolutely no support from them whatsoever in resolving the issue. So far we have: Removed the old website files off the server Developed a new website having implemented 301's for all the old URL's (except the spam ones) Submitted a reconsideration request for the manual spam action, which was accepted. Disavowed all the spammy inbound links through Webmaster Tools Implemented custom URL parameters through Google to not index the SPAM URLs ( which were using parameters) Our organic traffic is down by 63% compared to last year, and we are not ranking for most of our target keywords any longer. Is there anything that I am missing in the actions I have taken so far? We were advised that at this stage changing domain and starting again might be the way to go. However the current domain has been used by us since 2007, so it would be a big call. Any advice is appreciated, thanks. Sue - http://www.ultimatefloorsanding.co.uk/
Technical SEO | | galwaygirl0 -
Yoast's Magento Guide "Nofollowing unnecessary link" is that really a good idea?
I have been following Yoast's Magento guide here: https://yoast.com/articles/magento-seo/ Under section 3.2 it says: Nofollowing unnecessary links Another easy step to increase your Magento SEO is to stop linking to your login, checkout, wishlist, and all other non-content pages. The same goes for your RSS feeds, layered navigation, add to wishlist, add to compare etc. I always thought that nofollowing internal links is a bad idea as it just throwing link juice out the window. Why would Yoast recommend to do this? To me they are suggesting link sculpting via nofollowing but that has not worked since 2009!
Technical SEO | | PaddyDisplays0 -
Forum website rel="nofollow" is this Good?
Hi, Forum website rel="nofollow" is this Good? We have a Q & A site and have all links as Nofollow. Would this be a good way? Thanks
Technical SEO | | mtthompsons0 -
Missing Meta Tags - "thousands" using WooCommerce?
Recently took a site live for a client using WP/WooCommerce to replace their antiquated shopping cart site and have encountered thousands of "Missing Meta Description Tag" errors. Have researched and tried a couple different approaches, but nothing really seems to fix this problem. I'm happy to continue to research, but have never encountered this problem before. Anyone else encountered similar? If so, how did you fix? Which resources to start with? 2VKDRVx
Technical SEO | | twelvetwo.net0 -
Best META Fields to Include on New Site
I am in the process of transitioning sites to a Drupal CMS and am curious to know what META information to provide on each of the new site pages. Currently, this is the set-up I plan on using: My questions to the community are: whether or not I've added all pertinent information, and if there's anything I'm overlooking
Technical SEO | | NiallSmith0 -
Unknown "/" added causing 404 error
I have four 404 url redirect errors that I cannot sort out. It tells me the referring url: | www.homedestination.com/calculator-mortgage-resources.html has a "/" on the end. cannot find: | www.homedestination.com/calculator-mortgage-resources.html | I cannot figure out where this referring url is; as it is in the root file without a "/" on the end. Could it be on a page somewhere? All my Dreamweaver page link tests come back ok. I must be missing something simple and would value help for others who may spot it? Thanks! |
Technical SEO | | jessential0 -
How to turn WP site into Ecom site?
I have a couple of old wordpress sites that are old affiliate blogs. I currently sell products that are on amazon on these sites and sell quite a bit of volume. I have found a source and can afford the inventory to replace Amazon with my own product. So the dilema is how to turn these wordpress sites into ecommerce sites. The thing I am worried most about is that each site gets about 100-200 visitors a day for great buying keywords. I obviously don't want to lose my rankings. What are the options of turning a wordpress site into a store. I am not interested in plugins or some of the other solutions that make the store look very cheap and I would assume horribly convert. If you have inner pages ranking for keywords how does that work? Do the post pages become product pages? So to sum up I guess I am asking, what are the options that are of the higher quality that will also help me keep my rankings? Thanks
Technical SEO | | PEnterprises0