Login redirect 302
-
Ok - anyone knows what to do with the temporary redirect to the login page?
In our e-commerce system we have a checkout page, which requires user to be logged in - if they are not, we redirect them to the login page using simple php header("Locaiton: url"). This however has been found as a Warning as it's a temporary redirect. I can't really put there permanent redirect for obvious reasons so if someone could give me some clue on this situation that would be much appreciated.
-
No problem at all. Glad I could help. I think you've got it under control. I tend to over-think things a little bit after a long night, haha.
Last two cents...
There's a Magento extension I use on one of my stores that's very similar to what you're thinking of.
On the checkout page, the very first form requires the user to enter the billing info (just name, email, address, etc... not payment info), as well as password, and has a checkbox that asks the user if they would like to "Register for Future Convenience."
Above this first form there's a simple a link at the top that says "Already Registered? Login here." which replaces the billing info form with a login form if clicked.
I think something like that would work perfectly for your situation, you'd just need the addition of a password field to the billing info section, and a link that replaces the billing section with a login form when clicked. Depending on which method/form is displayed your button text would either be "Login and Continue" or "Register and Continue."
For new users who need to register, the only additional step as opposed to a "Guest Checkout" would be filling out a password field.
Good luck man.
-Anthony
-
Thanks Anthony,
I'm glad you like the site
I think I'm going to simply display login form directly on the checkout page if user is not logged and use canonical url to inform the crawlers that it is serving login page. We don't have access restriction to the basket so we shouldn't have a problem with it and out registration and login forms are on the separate pages - so again, these could be easily indexed by search engines.
Thanks for the advice - much appreciated!
-
Its not the link juice of the checkout page, its the link juice of the link pointing to the checkout page that is wasted.
if you did not have a link to the checkout page at all, but rather a link like login.aspx?url=checkout.aspx then you could redirect after the login, you would need a canonical in the login page to cater for the url parameter, but this way the link juice would go to the login page that is not behind authentication, and as long as you have a link back to the home page the link jucie would be returned. This way you will no longer have the warning, nor would you have the link juice leak
-
Thanks Alan - although I'm not sure what your suggestion to the problem is here.
We do have the redirect after login to point back to the checkout, but this isn't really the problem.
The fact that checkout is redirecting to the login is what the problem is referring to.
I'm not bothered whether search engines will drop the juice to the checkout page as it's behind the login anyway - I just want to make sure that the Warning is gone saying that there's a temporary redirect.
From what I can see the only way to do it is to serve the login page if they are not logged in under the checkout url and use canonical url to indicate that it is in fact the url of the login page.
It is a shame though that there isn't an option to inform search engines that the page they are trying to access is login protected.
-
Hey Sebastian,
I took a look at your site and I see what you're saying about guest checkout. Very nice by the way. I'm definitely going to keep your contact info handy so I'll have it the next time I need a custom modules built.
I do think adding the login form to the basket.html page would be the best way to go in this case. The only problem with that is if the user clicks on the Checkout button and bypasses the View Basket page...
Again, my php skills are horrible but I guess the general idea for the rule would be something like this:
For basket.html - if userisnotloggedin then echo HTML for the login form above the current basket.html content.
For checkout.html - if userisnotloggedin then echo HTML for login form above the current checkout.html content.
The problem with this scenario is that if the user isn't registered, you'd aslo need to dynamically display the HTML from register.html on the basket or checkout page when a user clicks "Register Now", instead of redirecting to a new page.
Could get a little complicated but it should eliminate the 302 warning.
Also, when I created an account I noticed I had to confirm it, so unless you've had problems with fake accounts, I'd remove that step from the conversion process.
Personally, I use the robots.txt file to disallow robot access to all of my cart, checkout, and account pages (login, register, or after login). The only drawback is you don't have the "Register" page indexed, but I don't think it's very likely that a user would land on a Registration page from a search engine result and proceed to register for a site without viewing any other content first.
Removing those pages from the index, combined with adding a no-follow tag to the View Basket and Checkout buttons links should get rid of the 302 error and any duplicate content issues without having to change your conversion flow, which seems to be very straightforward and user-friendly as it is.
It seems like you've got the skills to make it happen either way though, and keeping a user on the checkout page instead of redirecting them somewhere else never hurts.
I don't think the 302 warning will be affect your rankings much as it is, but to wrap it up... I'd either add the necessary Login and Registration forms to both the basket and checkout pages (only if the user isn't logged in) or disallow indexing of those pages and no-follow any links pointing to them, so the 302 isn't an issue.
-Anthony
-
You can send people directly to the login page and then send them to the checkout page when loged in.
You can allow googles ip to go to the page without authentication, but you might be seen as cloacking.
You could show a login on checkout page then, with ajax show page after login,
Or you can leave it how it is. Your only problem is that you are wasting link juice on the link that gets 302'ed
I prefere option 1, use a parameter to pass final destination, but put a canonical tag in the login page, make sure you have a link on the login page back to your home page to get the link juice back
-
Thanks Anthony,
The system is custom built so I can modify it the way I really need, however I cannot allow guest checkout as each purchase is associated with the account and in order to access goods (which in this case are video tutorials) user has to have an account so it wouldn't work that well in this situation.
An option perhaps would be to display login on the checkout page if user is not logged in, however in this case I will have a problem with duplicate content, unless I use the canonical url to indicate that checkout page is actually serving the login page.
We don't provide the after login access to the crawlers so that shouldn't be a big problem I guess.
Do you think this scenario would work?
-
Hi Sebastian,
What eCommerce platform are you using?
To be honest, I think the best solution would be to allow users to checkout without being logged in. Most eCommerce stores allow Guest Checkout because a lot of customers don't want to be forced to create a permanent account in order to make a purchase. I'm pretty positive you'd see an increase in Conversion Rate if you enable users to make purchases as guests.
If that's not an option for some reason, you might try letting the user create the account during the checkout process rather than redirecting them to the normal account creation page.
I'm pretty sure there's a way to redirect users to a page without using a 302 via php, but I'm far from being an expert in that language. On my eCommerce site if a customer clicks a link like "Order Tracking" or "Order History" without being logged in they're first taken to the login page, and then after logging in they're redirected to the original page that was requested. I'm not showing any 302 warnings from these links though. I'm using Magento, and while I'm very well versed in that CMS, I've got very little experience with other eCommerce platforms and can't really help you out with anything technical.
Again, I definitely think the best course of action would be to allow non-registered users to make purchases, which would eliminate the problem entirely and increase conversions.
Hope this helps and good luck!
-Anthony
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
-
Random post plugin creates 302 redirects. What should I do?
Just started work on a great MMA news site. In their footer, they have a plugin for random posts, which creates URL strings with '?random=1' on the end and then 302 redirects to a random article on the site. I know SEO-friendly protocol for redirects is to use 301 and not any of the other 300's. However, I don't really see the need to do 301s for these because of the fact that they are random! That said, I also don't want to leave 1000s of errors that can hinder the 'crawlability' (don't judge me - that's a word :)) of my client's site. My thought right now is to noindex the urls with the '?random=1' in the string, so the spider doesn't worry about crawling those links. Not sure if that is proper code, but it seems that would be quick and effective. Is there a better way to attack this? If you know, please share with me! WP publishers who use random post plugins: have you experienced this? How did you fix it within the friendly confines of Wordpress?
Intermediate & Advanced SEO | | Netrepid0 -
CPanel Redirect not allowing login access.
Using the redirect function in cPanel I am able to create the 301 redirect that I need to not have duplicate content issues in Moz. However, the issue now is that when I try to login to domain.com/login it redirects to domain.com/index.php?q=admin, which is not a page on the site and I can no longer login. I have checked the htaccess file and it appears that the entry is correct ( I originally thought that the cPanel redirect was not writing access correctly ). I am not sure if there is a small detail that I am missing with this or not. So my main question is how do I redirect my site to remove dup content errors while retaining the login at domain.com/admin and not be redirected to domain.com/index.php?q=admin? Thank you ahead of time for your assistance.
Intermediate & Advanced SEO | | Highline_Ideas0 -
Primary Domain or Redirect?
We are starting a new travel guide for a resort town. I have bought an expired domain with decent related links and PR (which seems to have survived the transfer (4 months ago). Beofre we launch the new site I am trying to decide if we should use this expired domain as the primary URL for the new site or just do a permanent redirect and buy a new domain that better matches the theme of the site. I am obviously concerned with starting from scatch with a new domain. I am confident we can build some good rellevant links in a short time but this space is very competetive. Any input would be greatly appreciated.
Intermediate & Advanced SEO | | Locals0 -
How to conduct catch 301 redirects & have the separate 301 redirects for the key pages
Hi, We've currently done a site migration mapping and 301 redirecting only the sites key pages. However two GWT (Google Webmaster Tools) is picking a massive amount of 404 areas and there has been some drop in rankings. I want to mitigate the site from further decline, and hence thought about doing a catch 301 - that is 301 redirecting the remaining pages found on the old site back to the home page, with the future aim of going through each URL one by one to redirect them to the page which is most relevant. Two questions, (1) can I do a catch 301 and if so what is the process and requirements that I have to give to the developer? (2) How do you reduce the number of increasing 404 errors from a site, despite doing 301 redirects and updating links on external linking sites. Note: The server is apache and the site is hosted on Wordpress platform. Regards, Vahe
Intermediate & Advanced SEO | | Vahe.Arabian0 -
How to use modrewrite to redirect certain portions of a site
Hello! My question is as follows: Suppose there is SiteA which is a blog that has a url structure of http://www.siteA.com/blog/category/article Now suppose I'd like to redirect those articles to a new domain (which has the same url structure) BUT excluding a certain category, say, 'blah/' so in other words, some examples: http://www.siteA.com/blog/shoes/best-shoes-to-buy ->redirects-> http://www.siteB.com/blog/shoes/best-shoes-to-buy/ (there is a trailing slash here for some reason) BUT http://www.siteA.com/blog/blah/foo-bar -NO REDIRECT- (because it's in the /blah/ category). Any and all feedback & help would be much appreciated 🙂 Thanks!~
Intermediate & Advanced SEO | | apo11o1770 -
Question about 301 redirect for trailing / ?
I am cleaning up a fairly large site. Some pages have a trailing slash on the end some don't. Some of the existing backlinks built used a trailing slash in the url and some didn't. We aren't concerned with picking a particular one but just want to get one set and stick to it from now on. I am wondering, would I clean this up within the same redirect in the htaccess file that takes care of the www and non www? example RewriteEngine On
Intermediate & Advanced SEO | | PEnterprises
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.domain.com/ [NC]
RewriteRule ^(.*)$ http://domain.com$1 [L,R=301] I currently use that to redirect the www. to the non www as you can see. However here is what I was confused about. Would this code be enough to redirect ALL pages with a / to the ones without? or would I also need to add another code (so there is 2) to my htaccess like below? RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com/ [NC]
RewriteRule ^(.*)$ http://domain.com$1 [L,R=301] RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.domain.com/ [NC]
RewriteRule ^(.*)$ http://domain.com$1 [L,R=301] That way, now, even the non www pages with a trailing slash will redirect to the non www without the trailing slash. Hopefully you understand what I am getting at. I just want to redirect EVERYTHING to the non www WITHOUT a / Thank you Jake0 -
How long is it safe to use a 302 redirect?
Hi All, Lets assume there is site A and site B, both sites are live on the internet today as standalone businesses, but they sell very similar products. Site B has built up some link equity and will eventually become the domain for site A due to an organisational re-brand. For the time being however site A will remain, but site B needs to disappear temporarily, but not lose the link equity which has been built up against it. My current thinking is to 302 redirect site B to site A such that users and search bots accessing site B will be redirected to site A whilst leaving the link equity that exists against site B fully intact and allowing us to continue to grow it should we wish to. The question is, does anybody have a view on how long it is safe to use a 302 temporary redirect for? i.e., is 8-10 months to long. Thanks, Ben
Intermediate & Advanced SEO | | BenRush0 -
Global Redirection Rules
SEO Moz Community: After twice changing directory software, I have a ton of 404 errors in Webmaster Tools (over 3,000). I've decided to do 301 redirects but can't manually enter in each 404 URL. How can you redirect pages from the same folder on a mass scale? For example, mysite.com/autos has hundreds of pages associated with it (/autos/ford, toyota etc.) How can you do a 301 that redirects all those pages without manually entering in each URL? Site is built on Wordpress
Intermediate & Advanced SEO | | JSOC0