![]() |
Problems setting up Seo friendly pages |
Post Reply ![]() |
Author | |
mattprice ![]() Senior Member ![]() Joined: 03-June-2007 Location: United Kingdom Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() 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("/"); } |
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
mattprice ![]() Senior Member ![]() Joined: 03-June-2007 Location: United Kingdom Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
![]() |
|
intour ![]() Senior Member ![]() Joined: 30-June-2006 Location: United Kingdom Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
mattprice ![]() Senior Member ![]() Joined: 03-June-2007 Location: United Kingdom Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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'. |
|
![]() |
|
intour ![]() Senior Member ![]() Joined: 30-June-2006 Location: United Kingdom Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
mattprice ![]() Senior Member ![]() Joined: 03-June-2007 Location: United Kingdom Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |