Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Am I able to issue a 302 redirect but leave the URL intact?

I want to track accesses to a URL in Google Analytics but just display my home page.

I am doing this on the assumption that Google Analytics tracks the URL in the address bar - is this correct?

i.e.

www.domain.com/landingpage

google sees URL of www.domain.com/landingpage

user sees content from www.domain.com (home page)

share|improve this question

1 Answer 1

To begin with, a 302 redirect does not do what you want on a functional level. A correct 302 redirect will actually redirect you from www.domain.com/landingpage to www.domain.com. That means the user will see www.domain.com in the address bar and Google will as well.

In order for you to have two URLs with the same content you would need to duplicate the content which is bad from an SEO standpoint for 2 reasons:

  1. Google will see it as duplicate content and possibly mark it as spam or just downgrade it for being duplicate
  2. Both www.domain.com/landingpage and www.domain.com will compete with each other for the same keywords and SERPs which means you essentially split the SEO value of your pages in half.

In general if you want someone to go to www.domain.com/landingpage and see the content on www.domain.com you would do a 301 redirect which is a permanent redirect.

The other solution is to use a canonical link tag like this, <link rel='canonical' href='http://www.domain.com/' /> on the page, www.domain.com/landingpage. This works because it tells Google that the content is duplicate or very similar and which page is the correct page to show when someone searches for terms found on both pages and at the same time lets you use www.domain.com/landingpage as a landing page for paid ads for example.

A 302 redirect is generally for temporary redirects or redirects for unspecified reasons. In general Google does not give you any benefit for 302 redirects.

See this, http://en.wikipedia.org/wiki/302_redirect#HTTP_status_codes_3xx for more info on what all redirect types mean.

share|improve this answer
    
Thanks for feedback. I do not have a page at www.domain.com/landingpage - It is just a line in htaccess which redirects to www.domain.com. The purpose is purely to try and track entry points into website on /landingpage (without actually setting up a landing page) the only reason I used a 302 is to keep the placeholder (we will probably put a page there) and in the meantime - show them something... but track accesses –  php-b-grader May 2 '11 at 2:29
    
I do not think that will work the way you want it to. –  RandomBen May 2 '11 at 3:00
    
If you're looking to track traffic from search engines rel='canonical' won't do the trick either since what that does is tell Google not to show example.com/landing in the search results because it's a duplicate of example.com. –  Joshak May 2 '11 at 12:54
    
@Joshak - It will work if the landing page had rel='canonical' and the plan is to get people to the landing page through means other than SERPs. –  RandomBen May 2 '11 at 19:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.