Real URL - No. I --- 5. Change an entry in detail.cgi
Open detail.cgi and find sub main :
sub main {
# --------------------------------------------------------
%in = &parse_form();
my (%rec) = &get_record ($in{'ID'});
unless ($in{'ID'}) {
&html_print_headers;
print &site_html_detailed_error ("Kein Link angegeben."); #future versions will load a form instead of an error
}
#### Redirection : Leitet altes URL Format auf neues HTML Format um:
elsif ($rec{$db_key} eq $in{'ID'}) {
my ($esd) = "http://.../links/Detailiert/" .$rec{'echteURL'} .".html";
print "Location: $esd\n\n";
}
# Original Code / Old code:
# elsif ($rec{$db_key} eq $in{'ID'}) {
# $title_unlinked = &build_unlinked_title ("$rec{'Kategorie'}/$rec{'Titel'}");
# $title_linked = &build_linked_title ("$rec{'Kategorie'}/$rec{'Titel'}");
# $thiscat = $rec{'Kategorie'};
# &html_print_headers;
# print &site_html_detailed (%rec);
# }
else {
&html_print_headers;
print &site_html_detailed_error ("Link $in{'ID'} nicht gefunden.");
}
}
Change the code as shown above.
The result is that old search engine entries are still valid and you dont even have to change entries in your html templates.
All entries like : http://.../cgi-bin/detail.cgi?ID=4964
will be redirected to their static html pages.
Andreas
Dr.Windows
Open detail.cgi and find sub main :
Code:
sub main {
# --------------------------------------------------------
%in = &parse_form();
my (%rec) = &get_record ($in{'ID'});
unless ($in{'ID'}) {
&html_print_headers;
print &site_html_detailed_error ("Kein Link angegeben."); #future versions will load a form instead of an error
}
#### Redirection : Leitet altes URL Format auf neues HTML Format um:
elsif ($rec{$db_key} eq $in{'ID'}) {
my ($esd) = "http://.../links/Detailiert/" .$rec{'echteURL'} .".html";
print "Location: $esd\n\n";
}
# Original Code / Old code:
# elsif ($rec{$db_key} eq $in{'ID'}) {
# $title_unlinked = &build_unlinked_title ("$rec{'Kategorie'}/$rec{'Titel'}");
# $title_linked = &build_linked_title ("$rec{'Kategorie'}/$rec{'Titel'}");
# $thiscat = $rec{'Kategorie'};
# &html_print_headers;
# print &site_html_detailed (%rec);
# }
else {
&html_print_headers;
print &site_html_detailed_error ("Link $in{'ID'} nicht gefunden.");
}
}
Change the code as shown above.
The result is that old search engine entries are still valid and you dont even have to change entries in your html templates.
All entries like : http://.../cgi-bin/detail.cgi?ID=4964
will be redirected to their static html pages.
Andreas
Dr.Windows