Redirect browser to local file
I'm just learning PERL. I installed ActivePerl on my win computer and run TinyWeb server. I wrote a little "Hello, World!" script that responds properly when I access it with my browser. It's called index.pl and it prints all the html code out to the browser so this works.
What I would like to try is have index.pl redirect to a local .html file. When I try this I get a "403 Forbidden" error. This is what I wrote:
I also just used print "Location: mytest.html";
print "Location: $URL\n\n";
I've put the .html file in the same folder as the .pl file as well as the root folder but I always get the same error. I can access the file by using localhost/mytest.html
I have some reading still to do but it seems my file should have been named index.cgi. Changing the name made it work but why didn't index.pl?
This is craaazzzy, man. Now index.pl works just fine and redirects to mytest.html. I don't know what I did but it's working now.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)