Zen Cart Logo
Forums / General Questions / site is 302 redirecting with zen id?

site is 302 redirecting with zen id?

Views: 2,582

Results 1 to 14 of 14
6 Jan 2011, 2:18 PM
#1
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

site is 302 redirecting with zen id?

i have been checking my www redirect, i have set my preferred domain in google as the www version and i have also set in my htaccess a 301 redirect from non www to www, i have checked these and they are working fine, but when checking in online tools (quite a fw different ones just to confirm) i get a notice saying that on the www version i have a 302 temporary redirect to the same url but with the zen id included.

when i type it in this doesnt seem to actually show up to users but its is showing up in these checks, it seems my site is doing some kind of a loop?

here is the information i have found:

#1 Server Response: http://livvylou.co.uk
HTTP Status Code: HTTP/1.1 301 Moved Permanently
Date: Thu, 06 Jan 2011 14:09:38 GMT
Server: Apache
Location: http://www.livvylou.co.uk/
Content-Length: 234
Content-Type: text/html; charset=iso-8859-1
Redirect Target: http://www.livvylou.co.uk/

#2 Server Response: http://www.livvylou.co.uk/
HTTP Status Code: HTTP/1.1 200 OK
Date: Thu, 06 Jan 2011 14:09:38 GMT
Server: Apache
X-Powered-By: PHP/5.2.13
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

this is the www redirect code i am using as suggested by my host as other versions were not working

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.livvylou\.co.uk
RewriteRule (.*) http://www.livvylou.co.uk/$1 [R=301,L]

my admin>config>sessions settings```
Cookie Domain True Info
Force Cookie Use False
Check SSL Session ID False
Check User Agent False
Check IP Address False
Prevent Spider Sessions True
Recreate Session True
IP to Host Conversion Status true
(ive made no changes here and this is just as was installed)

and this is the redirect check results

#1
Checked link: http://www.livvylou.co.uk

Type of redirect: 302 Moved Temporarily

Redirected to: http://www.livvylou.co.uk/?zenid=### (ive taken this out)

#2
Checked link: http://livvylou.co.uk/

Type of redirect: 301 Moved Permanently

Redirected to: http://www.livvylou.co.uk/


the second one is fine, i have set that up but i have no idea how or why the 302 is coming about, i have checked on my cpanel and i cant find anything set up to redirect, my template is heavily customised and using quite a few addons but i am not using any seourl rewrite modules or similar and cannnot see anything that would conflict with this. ive tried taking off the non www redirect and all that does is shos the zen id in the url, same issue

i would really appreciate any suggestions, thanks
6 Jan 2011, 6:08 PM
#2
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,290
Plugin Contributions:
39

Re: site is 302 redirecting with zen id?

It's not the zenids... It's the lack of default indexing... Try adding this.

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php?\ HTTP/
RewriteRule ^(.*)index\.php?$ www.livvylou.co.uk/$1 [R=301,L]

Cheers,
Melanie

6 Jan 2011, 6:27 PM
#3
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

thnkyou for your reply, i added that and it continued to work by redirecting the non www to www version, but the 302 redirection is still present. im wondering if it may be trouble with my server itself?

6 Jan 2011, 6:44 PM
#4
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,290
Plugin Contributions:
39

Re: site is 302 redirecting with zen id?

Okay, .co.uk domains are tricky as they are really sub domains... try these

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.co.uk$
RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [R=301,L] 
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.domain.co.uk/$1 [R=301,L]

~Melanie

6 Jan 2011, 6:51 PM
#5
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

thankyou very much again, i have tried each of those but none of those remove the 302 redirect. as i said they all continue to redirect the non www version to the www version perfectly but when i am checking the redirect status of https://www.livvylou.co.uk (note -with www) thats when it chucks up the 302 redirect from https://www.livvylou.co.uk to http://www.livvylou.co.uk/?zenid=...

this is driving me nuts!!! i really do appreciate your help :)

6 Jan 2011, 7:01 PM
#6
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,290
Plugin Contributions:
39

Re: site is 302 redirecting with zen id?

Check it using Live Headers... I think the tools are pulling incorrectly.

Or try this one with GoogleBot as the user agent, no redirect

http://web-sniffer.net/

~Melanie

6 Jan 2011, 7:07 PM
#7
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

The google bot comes back HTTP/1.1 200 OK on both www and non www but with no agent it looks like its pulling the same information?```
HTTP Request Header

Connect to 69.175.44.10 on port 80 ... ok

GET / HTTP/1.1[CRLF]
Host: www.livvylou.co.uk[CRLF]
Connection: close[CRLF]
Accept-Encoding: gzip[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no-cache[CRLF]
Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
Referer: http://web-sniffer.net/[CRLF]
[CRLF]

HTTP Response Header
Name Value Delim
Status: HTTP/1.1 302 Moved Temporarily
Date: Thu, 06 Jan 2011 19:06:15 GMT
Server: Apache
X-Powered-By: PHP/5.2.13
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: zenid=...; path=/; domain=www.livvylou.co.uk
Location: http://www.livvylou.co.uk/?zenid=...
Content-Length: 0
Connection: close
Content-Type: text/html

6 Jan 2011, 7:14 PM
#8
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,290
Plugin Contributions:
39

Re: site is 302 redirecting with zen id?

Under configuration >> sessions try setting the following

Cookie Domain True
Force Cookie Use True

~Melanie

6 Jan 2011, 7:26 PM
#9
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

brilliant! thats removed the 302 redirect from the www version perfectly although now it is showing both www and non www as direct links and the redirect from non to www is no longer working :S

although as i said the 302 redirect and zen id have gone! (getting there :D)

6 Jan 2011, 7:29 PM
#10
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,290
Plugin Contributions:
39

Re: site is 302 redirecting with zen id?

set your htaccess back to the original

~Melanie

6 Jan 2011, 7:39 PM
#11
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

ha ha of course, thank you so much for bearing with me!!!! and for all of your help!!!!

All is working perfectly now! :clap:

do you have a page where i can buy you a coffee to say thanks?

6 Jan 2011, 7:46 PM
#13
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

done and thanks again!

5 Mar 2011, 6:40 PM
#14
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: site is 302 redirecting with zen id?

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www.livvylou.co.uk
RewriteRule (.*) http://www.livvylou.co.uk/$1 [R=301,L]

Tidied up:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.livvylou\.co\.uk)?$
RewriteRule (.*) http://www.livvylou.co.uk/$1 [R=301,L]

Escape all literal periods, .uk for example.

The additional ( ) ? is required to stop HTTP/1.0 requests with blank hostname in the request resulting in an infinite redirect loop.

The original code would not redirect a www request with appended port number, leading to Duplicate Content issues. Adding the $ fixes that.

RewriteBase / is the default and is not required to be restated.