Jump to content

SSL / non SSL 404 errors


Hornblower

Recommended Posts

Adding items to basket and progressing to the basket is working pretty well. Hit the "view basket" button - OK so far.

From here on it all gets pretty nasty.

Hit any link that is not an add to basket button or the home button and you get either a 404 page or your basket emptied (as though you have started a new session?).

Hit the home button and you sort of get there:

http://www.charisma-art.co.uk/~charisma/index.php?PHPSESSID=38d49612c7......

Hit another button and it get closer to the non SSL address:

http://www.charisma-art.co.uk/~charisma/collections.html

Hit a third button and wahey! back at the proper non SSL addresss:

http://www.charisma-art.co.uk/pictures.html

Turn off SSL and everthing goes to the right place.

Obviously having buttons which send people to a 404 page is completely unacceptable - any ideas?

Link to comment
Share on other sites

Not quite got to the exact problem but it was something to do with SEO friendly ULR's / htaccess - thanks for the heads up on this bsmither - may also been something to do with host as I also started to get messages about maintenance. Who knows?

Anyway turned of SEO, re-sent .htaccess file (from admin) and everything started working correctly.

Link to comment
Share on other sites

bsmither's idea wasn't a fix just a suggestion - and a little bit of a wild goose chase.

There is a bug report about this issue but I think ther suggested fix has got the syntax wrong, and having tried it - it doesn't fix i.

The suggestion is to add


'plugin',

on the end of line 56 (which currently ends 'vieworder',)

I think that both are incorrect in that they both have a trailing comma (end with a ",") and as they are the last element in a list. However I tried it both ways an neither work to fix the problem.

I am looking into this further and will post anything else I find - though feeling a bit frustrated that this is the sort of error that should have been picked up in beta testing - to release software with this many bugs smacks of carelessness.

Link to comment
Share on other sites

I'll start this post with a little caveat: it is a few years since I have truly got down and dirty with code - and then my bag was ColdFusion and not PHP.

However this is how I see this situation:

The problem only occurs when both SEO freindly URL's and SSL options are chosen. It does not matter which skin you choose it even fails with the 'vanilla' version. This suggests it is down to the underlying code and not skins.

Instant fix:

Turn one of them off.

However this is not a true solution.

Turn off SSL and anybody with a small ammount of knowledge won't use an unsecured shopping basket.

Turn off SEO friendly URL and you make it a nightmare for search engines to index your site and you end up getting phone calls and emails from companies offering to get you up google rankings using their unique system blah blah blah (I am sure we have all had those calls).

Following some suggestion from bsmither I has a look at the .htaccess file

The line that could be causing the problem could be:


RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]



but given the thoughts above I don't think it is - I beleive this would either work or not - not just some of the time.



Lines 35 - 40 of controller.index.inc.php



//Initialize SEO

$GLOBALS['seo'] = SEO::getInstance();

if(isset($_GET['seo_path']) && !empty($_GET['seo_path'])) {

$_GET['seo_path'] = preg_replace('/(/~[a-z0-9]{1,}/)/','',$_GET['seo_path']); // Remove /~username/ from seo_path

$GLOBALS['seo']->getItem($_GET['seo_path']);

}



are not working as it is leaving /~charisma in the URL of the links on my site once out of the https:// area.



I do not undestand why this is not working as it look like a properly formated regex to me - but as I have already said I'm a bit rusty. This may suggest that there are further problems with seo.class.php 



There is another regex on line 86



(.*/)?[w]+.[a-z]+?_a=([w]+)&(amp;)?([w]+)=([w-_]+)([^"']*)

these were always the first things I would check.

That is about a far as I can go on this .... I hand it over to the experts now like Al, bsmther & Dirty Butter in the hope that a solution can be found soon ..... please!

Link to comment
Share on other sites

Reading back my last post I have just had a thought the first regex is commented by CC as removing /~username/ .

Shouldn't one of the foward slashes remain ???

so instead of


preg_replace('/(/~[a-z0-9]{1,}/)/','',$_GET['seo_path']);



shouldn't it be



preg_replace('/(/~[a-z0-9]{1,}/)/','/',$_GET['seo_path']);

I'll try and see what happens!

Link to comment
Share on other sites

I still think that the '/' is needed in the first reg ex - so have left it in. If it is not there you will remove one too many '/' and any link will be incorrect - PLEASE PLEASE PLEASE correct me if I am mis-reading this bit of code.

There is deffinitely something wrong with how CC is generating links once you go into https:// .

I do not know enough php to point out exactly where but any link on the page ending in .html will cause 404 errors when clicked, it appears that they need to end with "/index.php>?_a=......". This means that all the login and register buttons fail - this is a MAJOR problem!!

I hope that this may at least point someone in the right direction .... but I have reached the limit of what I can do.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...