Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

localhost url repeating on internal links

by traincity (Sexton)
on Jun 29, 2019 at 19:32 UTC ( [id://11102126]=perlquestion: print w/replies, xml ) Need Help??

traincity has asked for the wisdom of the Perl Monks concerning the following question:

I am having further problems with my migration to localhost. When I click on an internal link I get this as the link:
http://localhost/choo/cgi-bin/ua/localhost/choo/cgi-bin/ua/main.pl (The link is repeating itself somehow.)

The code this is coming from is this:

<A HREF="<!--GLOBAL::script_dir_url-->/main.pl">Main Page</a> | <A HRE +F="<!--GLOBAL::script_dir_url-->/browse.pl">Browse</a> |<!-- <A HREF= +"<!--GLOBAL::script_dir_url-->/newitem.pl">Sell</a> |--> <!--<A HREF= +"<!--GLOBAL::script_dir_url-->/gallery.pl">Gallery</a> |-->

I thought possibly it had something to do with scriptalias in apache (2.4) or addhandler (.pl) But I disabled those and it continues to double up on the link. I am not familiar with the global script so I'm not sure if possibly that is causing this or something else.

This is happening in windows 10 environment using the latest Strawberry edition. Any ideas on a fix?

Thanks for any help.

Replies are listed 'Best First'.
Re: localhost url repeating on internal links
by haukex (Archbishop) on Jun 30, 2019 at 12:16 UTC

    You'd have to locate the place where GLOBAL::script_dir_url gets set, perhaps by grepping for script_dir_url. Since you've described earlier that this code works on a *NIX server and not Windows, you might want to check if you've got the same module versions installed on both, although without knowing what the code that sets the variable looks like, I can't say which ones. Also, looking at the %ENV variables provided by Apache to the CGIs on each system might give a clue, e.g. with a test script that simply does use Data::Dumper; print Dumper \%ENV;.

      OK thanks very much for your response. I'll check those out.
      Thanks again for your help on this. Somehow I was able to manipulate the variables so that it now works.
Re: localhost url repeating on internal links
by Anonymous Monk on Jun 30, 2019 at 03:45 UTC
    So youre asking why some variables have some certain value at some certain point in some certain code of yours that only you can see?
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11102126]
Approved by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-16 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found