ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Problems setting up Seo friendly pages
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems setting up Seo friendly pages

 Post Reply Post Reply
Author
Message
mattprice View Drop Down
Senior Member
Senior Member


Joined: 03-June-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattprice Quote  Post ReplyReply Direct Link To This Post Topic: Problems setting up Seo friendly pages
    Posted: 14-June-2009 at 12:34pm
Hi folks,
 
I have been trying to set up seo friendly pages according to the WIKI guide http://wiki.earlyimpact.com/productcart/seo-urls in my V3.51 store.
 
I have uploaded all the appropriate files OK but am getting 500 Internal server errors on my seo friendly generated pages.  I think it may be due to the way my host handles the custom 404 redirect.  I had to specify a path to my /pc folder which then runs a cgi script (below).  Can anyone confirm that this is the likely problem ?  Many Thanks
 
 
#!/usr/bin/perl -w
use strict;
(my $cwd=$0)=~s/^(.*)\\.*?$/$1/;
chdir($cwd) if $cwd ne $0;
my ($email_400, $email_500, $unfriendly_error, $redirect_to);
my $main_domain=$ENV{SERVER_NAME};
my @sendmail_path=(qw(/usr/sbin/sendmail -i -odb), "-fwebmaster\@$main_domain");
## Uncomment the below two lines to get emailed regarding the respective
## errors.
#$email_400="webmaster\@$main_domain";
#$email_500="webmaster\@$main_domain";
## If you want people to end up at a particular page for a 404 (Not Found) and
## you've used the $email_400 value above, then uncomment (and edit) the value
## below.
#
$redirect_to = "404.asp";
## Comment-out the line below to make the script return the actual HTTP status
## code, rather than 200 (success). Don't comment it out if you want all users
## of MSIE (specifically those with "Show Friendly Error Messages" turned on)
## to be able to see your error pages.
#
## $unfriendly_error=1;
#
##
## End of configuration
##
## You shouldn't need to edit anything below.
 
sub send_mail($$) {
        my ($to,$message)=@_;
        open(SENDMAIL, "|-", @sendmail_path, $to) or die $!;
        print SENDMAIL $message;
        close SENDMAIL;
}
use CGI;
my $cgi=new CGI;
if($cgi->param("404")) {
 if($redirect_to) {
  # If there's a URL to redirect to, then let's do that.
  # The webmaster could in fact have set this directly in
  # the .htaccess file.
  print $cgi->redirect($redirect_to);
 } elsif(open IFILE, "<", "404.html") {
  # Otherwise, we send the default file
  print $cgi->header(-type=>"text/html", -status=>$unfriendly_error?200:404);
  print while <IFILE>;
  close IFILE;
 } else {
  # If we can't find the 404 template, then we really should
  # just give an empty 404 (and hope the server fills it in)
  print $cgi->header(-status=>404);
 }
 if($email_400) {
  send_mail($email_400, <<EOF );
To: $email_400
From: webmaster\@$main_domain
Subject: Missing file
 
A request was received for the file $ENV{HTTP_REFERER}, which does not exist.
EOF
 }
} elsif($cgi->param("500")) {
 if(open IFILE, "<", "500.html") {
  print $cgi->header(-type=>"text/html", -status=>$unfriendly_error?200:500);
  print while <IFILE>;
  close IFILE;
 } else {
  # No template? Then just send a 500 and cross fingers.
  # Under no circumstances should this redirect.
  print $cgi->header(-status=>500);
 }
 if($email_500) {
  send_mail($email_500, <<EOF );
To: $email_500
From: webmaster\@$main_domain
Subject: Script error
 
A request was received for the file $ENV{HTTP_REFERER}, which caused an
internal server error.
 
EOF
 }
} else {
 # Last ditch effort: redirect to the home page.
 print $cgi->redirect("/");
}
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 14-June-2009 at 1:10pm
Hi Matt,
Can you give us a sense of why you are putting yourself through the process of writing CGI code to make this work?  If it is to accomodate your hosting environment, why not work with Mark Shipp or Nigel - both of whom operate servers in the UK, and just do this with stock code which works so easily and reliably?
 
on edit - spelling error on "yourself"


Edited by Greg Dinger - 14-June-2009 at 4:29pm
Back to Top
mattprice View Drop Down
Senior Member
Senior Member


Joined: 03-June-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattprice Quote  Post ReplyReply Direct Link To This Post Posted: 14-June-2009 at 2:46pm
Hi Greg,
 
You are right...    The only reason I am working with this a particular host is because I have a reseller account with loads of other Linux sites on.  Their windows hosting is a bit ropey and I have already had performance issues on a store which is not even live yet.
 
Please can you let me know the business names for the hosting offered by Mark or Nigel ?
 
Thanks
Matt
 
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 14-June-2009 at 4:06pm
Back to Top
intour View Drop Down
Senior Member
Senior Member


Joined: 30-June-2006
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote intour Quote  Post ReplyReply Direct Link To This Post Posted: 15-June-2009 at 7:25am
Hi Matt,
 
I do offer producart hosting and the server is set up with all the productcart components. The SEO friendly pages work fine and the process is seamless. The only part I have to do personally is a small change in IIS (as per the wiki instructions).
 
If you want to switch hosting for your productcart site please get in touch.
 
Nigel
 
 
Innerview
Productcart Platinum Reseller
Web Design/Hosting/Virtual Tours
Back to Top
mattprice View Drop Down
Senior Member
Senior Member


Joined: 03-June-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattprice Quote  Post ReplyReply Direct Link To This Post Posted: 17-June-2009 at 7:41am
Thanks Nigel,
 
A friend has now set this up for me on their server but I will certainly come back to you if I get any further problems.  The seo friendly pages are working perfectly now.
 
I did have one query though which is bothering me.  I received a .sql backup which was executed on the new database on the new server as part of the transfer.  I did receive the following messages on multiple lines.  The store seems to be working fine but I am frightened I may encounter a problem in the future.  Does anybody know what the following SQL messages mean and whether it is likely to be a problem ?
 
Many thanks
 
Matt
 

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near 'DISABLE'.
 
Back to Top
intour View Drop Down
Senior Member
Senior Member


Joined: 30-June-2006
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote intour Quote  Post ReplyReply Direct Link To This Post Posted: 22-June-2009 at 5:10am
I googled that response code out of interest and there were so many variations of what it could be.
 
The most common was that something was named incorrectly.
 
Nigel
Innerview
Productcart Platinum Reseller
Web Design/Hosting/Virtual Tours
Back to Top
mattprice View Drop Down
Senior Member
Senior Member


Joined: 03-June-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattprice Quote  Post ReplyReply Direct Link To This Post Posted: 22-June-2009 at 5:25am
Thanks Nigel,
 
I did the same.  So far I have'nt come across any issues.  Hopefully it wont catch me out in the future !!
 
 
Matt
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.064 seconds.