Note this is using the latest BETA for LinkSQL.
Here is the bit of code in question:
In &clean_output look for:
$$output_ref =~ s!(<a[^>]+href\s*=\s*["']*)$LINKS{db_cgi_url}/([^"'>]+(cgi|pl)([^"'>]*))!
($begin, $url) = ($1, $2);
if ($original) {
($url =~ /\?/) ? ($output = "$begin$LINKS{db_cgi_url}/$url&$original")
: ($output = "$begin$LINKS{db_cgi_url}/$url?$original");
}
else { $output = "$begin$LINKS{db_cgi_url}/$url"; }
$output;
!eisog;
# Fix up any HTML forms, and insert hidden tags.
$$output_ref =~ s!(<form[^>]+> )!$1$form!isg;
# Fix up the HTML references
$$output_ref =~ s!(<a[^>]+href\s*=\s*["']*)$LINKS{build_root_url}/?([^"'>]*)!
($begin, $url) = ($1, $2);
if ($url =~ /\.(jpe?g|gif|cgi|pl)/) { #ADD The bolded part
$output = "$begin$LINKS{build_root_url}/$url";
}
else {
($original) ? ($output = "$1$LINKS{db_cgi_url}/page.cgi?g=" . &escape($2) . "&$original")
: ($output = "$1$LINKS{db_cgi_url}/page.cgi?g=" . &escape($2));
}
$output;
!eisog;
I know I've done a lot of hefty modifications to the scripts so, it could be something in those that is affecting my current observation. Though this is one of the subs I haven't played with and kept the modification in it. When page.cgi automatically generates it's pages....
Here is something I noticed happening with this links.pm setting:
$LINKS{build_root_url} = "http://www.mvsource.com";
http://www.mvsource.com/cgi-bin/biz/page.cgi?g=cgi-bin%2Fsubscribe.cgi%3Fd%3D1&d=1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Except for the Categories output which comes out as it should. It looks like it could be doing the first step properly for the <%db_cgi_url%> 'cgi-bin' replacements...but then because they are still in an href tag, they are getting redone by the <%build_root_url%> part, because there is no directory being used to differentiate.
With these settings:
$LINKS{build_root_url} = "http://www.mvsource.com/mv";
Everything works fine, which for me isn't going to be a problem because I don't plan on using the static pages, except for tools that search engines can index on. But I do want them to index the site so that they are pointing to the root of my site so I can redirect real visitors straight to page.cgi
Now I don't know if this will fix the problem but it might, I'd feel more comfortable if Alex verified it for me before anyone took it for granted:
I haven't tried so I'm not sure, if this is the solution...
~rl
[This message has been edited by phoule (edited March 09, 2000).]
[This message has been edited by phoule (edited March 09, 2000).]
Here is the bit of code in question:
In &clean_output look for:
Code:
# Fix up the CGI references. $$output_ref =~ s!(<a[^>]+href\s*=\s*["']*)$LINKS{db_cgi_url}/([^"'>]+(cgi|pl)([^"'>]*))!
($begin, $url) = ($1, $2);
if ($original) {
($url =~ /\?/) ? ($output = "$begin$LINKS{db_cgi_url}/$url&$original")
: ($output = "$begin$LINKS{db_cgi_url}/$url?$original");
}
else { $output = "$begin$LINKS{db_cgi_url}/$url"; }
$output;
!eisog;
# Fix up any HTML forms, and insert hidden tags.
$$output_ref =~ s!(<form[^>]+> )!$1$form!isg;
# Fix up the HTML references
$$output_ref =~ s!(<a[^>]+href\s*=\s*["']*)$LINKS{build_root_url}/?([^"'>]*)!
($begin, $url) = ($1, $2);
if ($url =~ /\.(jpe?g|gif|cgi|pl)/) { #ADD The bolded part
$output = "$begin$LINKS{build_root_url}/$url";
}
else {
($original) ? ($output = "$1$LINKS{db_cgi_url}/page.cgi?g=" . &escape($2) . "&$original")
: ($output = "$1$LINKS{db_cgi_url}/page.cgi?g=" . &escape($2));
}
$output;
!eisog;
I know I've done a lot of hefty modifications to the scripts so, it could be something in those that is affecting my current observation. Though this is one of the subs I haven't played with and kept the modification in it. When page.cgi automatically generates it's pages....
Here is something I noticed happening with this links.pm setting:
$LINKS{build_root_url} = "http://www.mvsource.com";
http://www.mvsource.com/cgi-bin/biz/page.cgi?g=cgi-bin%2Fsubscribe.cgi%3Fd%3D1&d=1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Except for the Categories output which comes out as it should. It looks like it could be doing the first step properly for the <%db_cgi_url%> 'cgi-bin' replacements...but then because they are still in an href tag, they are getting redone by the <%build_root_url%> part, because there is no directory being used to differentiate.
With these settings:
$LINKS{build_root_url} = "http://www.mvsource.com/mv";
Everything works fine, which for me isn't going to be a problem because I don't plan on using the static pages, except for tools that search engines can index on. But I do want them to index the site so that they are pointing to the root of my site so I can redirect real visitors straight to page.cgi
Now I don't know if this will fix the problem but it might, I'd feel more comfortable if Alex verified it for me before anyone took it for granted:
I haven't tried so I'm not sure, if this is the solution...
~rl
[This message has been edited by phoule (edited March 09, 2000).]
[This message has been edited by phoule (edited March 09, 2000).]