icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.
Old March 20th, 2008, 4:48 PM   #1 (permalink)
Registered User
Seasoned Poster
 
Eraemia's Avatar
 
Joined in Jul 2004
Hosted on Pipe and Mac
39 posts
Gave thanks: 3
Thanked 3 times
[Answered] Internal Server Error for .pl files

When I open the following file:
http://fishy.nu/irssi/beep_beep.pl

I receive a 500 Internal Server Error. It seems like the server is trying to read it as cgi.

I can rename the file so that it doesn't end in .pl, but is there a way to view it without changing the file extension?

For example, I'd like to be able to open it as such:
http://irssi.org/scripts/scripts/beep_beep.pl

Thanks,
Eraemia

Last edited by Eraemia; March 20th, 2008 at 4:50 PM.
Eraemia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 20th, 2008, 6:30 PM   #2 (permalink)
Surpass Staff
Comfy Contributor
 
Thomas's Avatar
 
Joined in Nov 2007
139 posts
Gave thanks: 9
Thanked 13 times
There's likely a handler in the .htaccess for irssi.org that forces .pl extensions to be opened as text, is there any way you can check for this handler and copy it over to the fishy.nu server? I would've checked for you, but the sites are not on our network :-(
__________________
Thomas
https://desk.surpasshosting.com/
Thomas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 20th, 2008, 7:17 PM   #3 (permalink)
Registered User
Seasoned Poster
 
Eraemia's Avatar
 
Joined in Jul 2004
Hosted on Pipe and Mac
39 posts
Gave thanks: 3
Thanked 3 times
Thanks for your reply.

I googled for how to perhaps edit the .htaccess file to force .pl files to be read as text files. I found this useful website:

Stupid htaccess Tricks • Perishable Press
(Search for "Instruct server to display source code for dynamic file types")

which suggests to add the following code to .htaccess:
Code:
RemoveHandler cgi-script .pl .py .cgi
I still cannot view my .pl files after adding that line of code into .htaccess, so I have two questions:
1. How do I implement the code from the website?
2. How do I limit .htaccess to just one subfolder instead of the entire root?

Thanks,
Eraemia
Eraemia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 21st, 2008, 3:47 AM   #4 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
924 posts
Gave thanks: 2
Thanked 91 times
In the folder that contains the .pl files you want displayed as text, make a .htaccess file containing the following and upload to that directory:
Code:
RemoveHandler .pl
AddType text/plain .pl
Either line should work by itself, but, overkill is OK.

Do not add or alter the .htaccess file in the public_html directory, unless, you want site-wide changes.
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
These users thank cowboy for this great post!
Eraemia (March 21st, 2008), Thomas (March 21st, 2008)
Old March 21st, 2008, 1:41 PM   #5 (permalink)
Registered User
Seasoned Poster
 
Eraemia's Avatar
 
Joined in Jul 2004
Hosted on Pipe and Mac
39 posts
Gave thanks: 3
Thanked 3 times
Thanks, that worked perfectly!
Eraemia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 21st, 2008, 1:43 PM   #6 (permalink)
Surpass Staff
Comfy Contributor
 
Thomas's Avatar
 
Joined in Nov 2007
139 posts
Gave thanks: 9
Thanked 13 times
*Adding to my list of useful htaccess code* :-)
__________________
Thomas
https://desk.surpasshosting.com/
Thomas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On