Print Page | Close Window

Problems setting up Seo friendly pages

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=2799
Printed Date: 29-May-2025 at 4:15am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems setting up Seo friendly pages
Posted By: mattprice
Subject: Problems setting up Seo friendly pages
Date 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 - 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("/");
}



Replies:
Posted By: Greg Dinger
Date 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"


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: mattprice
Date 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
 


Posted By: Greg Dinger
Date Posted: 14-June-2009 at 4:06pm
Mark: mailto:mark@cognecy.com - mark@cognecy.com
http://www.innerview.co.uk/ -
Nigel: http://www.innerview.co.uk/


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: intour
Date 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
 
 


-------------
http://www.innerview.co.uk - Innerview
Productcart Platinum Reseller
Web Design/Hosting/Virtual Tours


Posted By: mattprice
Date 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'.
 


Posted By: intour
Date 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


-------------
http://www.innerview.co.uk - Innerview
Productcart Platinum Reseller
Web Design/Hosting/Virtual Tours


Posted By: mattprice
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net