Forums / General Questions / Problem with redirects

Problem with redirects

Results 1 to 20 of 24
03 Mar 2015, 17:30
#1
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Problem with redirects

I'm having a problem that's a real head scratcher. When you enter a search term that is not found it gives the message:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

A valid search works correctly. This site was recently upgraded from 1.3.9 and has the CEON URI mapping mod installed and active. PHP 5.3.29 MySQL 5.5.41-cll-lve. A complete list of mods is:
blank sidebox
advanced shipper
ceon uri mapping manager
ckeditor
email archive manager
google analytics
image handler 4.3.2
cowoa 2.4
mydebug backtrace
numinix facebook lke button
product listing sorter
tabbed product pro
thub
timezone fix
ty package tracker

There a no errors being logged and the server logs are not showing anything. Anybody have any suggestions on how to debug this? Here's a link to the site if you want to see the problem http://tinyurl.com/qay5dhe
03 Mar 2015, 17:39
#2
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

Just a quick update. The hosting company was able to see the following in the logs:
Its actually causing a small flood, you can see here in the access logs (only the first copied):

x.x.x.x- - [03/Mar/2015:11:21:44 -0600] "GET /index.php?main_page=advanced_search&search_in_description=1&keyword=sebhor&inc_subcat=0&sort=20a HTTP/1.1" 302 24 "http://domain.com/"; "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko"
x.x.x.x - - [03/Mar/2015:11:21:44 -0600] "GET /index.php?main_page=advanced_search&search_in_description=1&keyword=sebhor&inc_subcat=0&sort=20a HTTP/1.1" 302 24
You can see its 3-4 times a second, that is your IP so its obviously not malicious. It doesn't appear to be from htaccess so something like an internal PHP redirect. Do you have any mods that use rewrites like SEO?


So it seems it's related to the CEON SEO mods.
03 Mar 2015, 17:53
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Posts:
13,980
Plugin Contributions:
46

Re: Problem with redirects

To validate your theory, you could temporarily turn the Ceon SEO 'off' ...

Additionally, I noticed:
&inc_s ubcat=0&

Is there really that space between &inc_ and ubcat?
03 Mar 2015, 18:03
#4
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

No extra space. It must have been from the cut and paste. I tried turning it off and interestingly it does not make a difference. This is the only situation where it happens and the rewrites work perfectly in all other pages and it works correctly if the search term is found.
03 Mar 2015, 18:06
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

badarac:


So it seems it's related to the CEON SEO mods.


This is almost always the case (can happen with any SEO mod that doesn't take everything into consideration, or one that has additional rules added to the .htaccess file (possibly in the wrong order).

@lat9
"Is there really that space between &inc_ and [B]ubcat?"

[/B]The answer is No. Here's what the actual URL shows.
index.php?main_page=advanced_search&search_in_description=1&keyword=QWERTY&inc_subcat=0&sort=20a


Cheers
RodG
03 Mar 2015, 18:09
#6
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

badarac:

I tried turning it off and interestingly it does not make a difference.


Try renaming or removing the .htaccess file. Does the problem still persist?

Cheers
RodG
03 Mar 2015, 18:14
#7
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

With the htacces file renamed and the seo mod turned off it still happens. I guess I'm going to need to look at the search form and what happens when it doesn't find a match.
03 Mar 2015, 18:16
#8
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

RodG:


@lat9
"Is there really that space between &inc_ and [B]ubcat?"

[/B]The answer is No. Here's what the actual URL shows.
index.php?main_page=advanced_search&search_in_description=1&keyword=QWERTY&inc_subcat=0&sort=20a

Cheers
RodG


Oooer. I think you may be in to something here. I just noted that MY cut n paste also has this space. It ISN'T showing in the URL though.

I think some kind of odd character has managed to creep in somewhere that is messing with things.

More investigationing needed.

Cheers
RodG
03 Mar 2015, 18:18
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

badarac:

With the htacces file renamed and the seo mod turned off it still happens. I guess I'm going to need to look at the search form and what happens when it doesn't find a match.


See my next/previous message. We appear to be barking up the wrong tree.

There is *something* amiss with the "inc_s ubcat".

Offhand I don't know where that is set or defined, but find and fix that and you'll probably fix the issue.

Cheers
RodG
03 Mar 2015, 18:27
#10
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

RodG:


More investigationing needed.


templates/tpl_advanced_search_default.php (or the same named file in your CUSTOM_TEMPLATE folder)


Probably around line#35

<?php echo zen_draw_checkbox_field('inc_subcat', '1', $sData['inc_subcat'], 'id="inc-subcat"'); ?>


Re-enter the 'inc_subcat' in both places, even if it *looks* ok. (type it. Don't cut n paste)

Cheers
RodG
03 Mar 2015, 18:39
#11
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

That didn't make any difference. I'm not seeing the space though. If I enter a valid search here's what I see /index.php?main_page=advanced_search_result&search_in_description=1&keyword=silk&x=13&y=16 invalid /index.php?main_page=advanced_search&search_in_description=1&keyword=Seborrheic&inc_subcat=0&sort=20a
03 Mar 2015, 18:50
#12
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

badarac:

That didn't make any difference. I'm not seeing the space though. If I enter a valid search here's what I see /index.php?main_page=advanced_search_result&search_in_description=1&keyword=silk&x=13&y=16 invalid /index.php?main_page=advanced_search&search_in_description=1&keyword=Seborrheic&inc_subcat=0&sort=20a


Frankly, I really don't know what to make of this.

Yes, the URL's are looking correct, but only until we paste them into this forum where the space seems to magically appear.

I've noticed that your latest paste has the space in a different place this time. In between the 'i' and 'n'.

I've tried pasting these URL's into several different editors and none of them replicate the problem.

I'm really totally stumped at this point.

The only other suggestion I could make is for you to remove the tpl file in your custom folder (if one exists there) and/or replace this file with a ZenCart original.

I'm not convinced that this will solve the problem either though. The space may be just a quirk of the forum editor which means we are barking up another wrong tree,

As for me. Tis almost 5:30am... Time for bed.

Cheers
RodG
03 Mar 2015, 18:50
#13
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

I found it. It looks like the contents of includes/modules/pages/advanced_search/header_php.php was overlaid with the contents of includes/modules/pages/advanced_search_results/header_php.php. It didn't generate any errors but definitely broke stuff. Thanks for the help!
03 Mar 2015, 18:54
#14
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

badarac:

I found it.


Good stuff. I'd have NEVER thought of that one. :)

Now the 'big' test. What does the pasted URL look like this time?

index.php?main_page=advanced_search&search_in_description=1&keyword=QWERTY&inc_subcat=0&sort=20a

Cheers
RodG

ps. Looks fine when pasting (still), but after submitting the message the space appears (still). How weird is that!!!
03 Mar 2015, 18:59
#15
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

It looks fine index.php?main_page=advanced_search&search_in_description=1&keyword=QWERTY&inc_subcat=0&sort=20a and the result is the expected message There is no product that matches the search criteria. That was certainly a brain teaser.
03 Mar 2015, 20:11
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Problem with redirects

And yet the space still exists when pasted herein. Any possibility that the text needs to be retyped "again" or at least tried? :)
03 Mar 2015, 20:32
#17
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

mc12345678:

And yet the space still exists when pasted herein. Any possibility that the text needs to be retyped "again" or at least tried? :)

That's really weird. It's working correctly on the website and it looks fine when I post it here. This all makes my head hurt.
04 Mar 2015, 09:22
#18
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Problem with redirects

mc12345678:

And yet the space still exists when pasted herein. Any possibility that the text needs to be retyped "again" or at least tried? :)


See the ps in post#14

Cheers
RodG
04 Mar 2015, 12:25
#19
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Posts:
13,980
Plugin Contributions:
46

Re: Problem with redirects

Could it be some funky CHARSET thing, like the website is running ISO-8859-1 but the PHP file was saved as UTF8-without-BOM?
04 Mar 2015, 12:50
#20
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Posts:
635
Plugin Contributions:
0

Re: Problem with redirects

I retyped the text, made sure that it was utf-8, and replaced the file on the server. The search box works correctly and the url appeared in the browser without the space. When I paste it into the reply box it does not include the space. The result after saving this reply is: /index.php?main_page=advanced_search&search_in_description=1&keyword=QWERTY&inc_subcat=0&sort=20a. Intrestingly when I post it as a url it appears correctly when you hover over it. http://domain.com/index.php?main_page=advanced_search&search_in_description=1&keyword=QWERTY&inc_subcat=0&sort=20a