开发者

.htaccess headache with perl script?

开发者 https://www.devze.com 2023-01-06 18:52 出处:网络
Trying to get a simple test perl script working. Have the following files/folder structure on a shared hosting service:

Trying to get a simple test perl script working. Have the following files/folder structure on a shared hosting service:

~/public_html/

  • .htaccess

~/public_html/lookup Permissions: "drwxrwxrwx 2 myusername myusername"

  • .htaccess
  • lookup.pl* Permissions: "-rwxr-xr-x myusername myusername"

The first .htaccess contains:

# disable directory browsing
Options All -Indexes

RewriteEngine on
RewriteBase /
RewriteRule ^(r)$ $1/ [R]
RewriteRule ^(r)/(.*)(\.[a-z]+)$ redirect.php?$1 [L]
RewriteRule ^(r)/(.*)$ redirect.php?$1 [L]

The second .htaccess contains:

RewriteEngine On
RewriteBase /lookup

RewriteCond %{REQUEST_URI} !^/lookup/lookup.pl [NC]
RewriteCond %{REQUEST_URI} !\.(css|png|jpg|gif)$ [NC]
RewriteRule ^(.*)$ lookup.pl/$1 [QSA,NC]

But direct ac开发者_运维问答cess to: www.mysite.com/lookup/lookup.pl does not work and shows a "500 Internal Server Error"


Just a rough guess, because I don't know your complete configuration: Are you running the site under suEXEC (having a VirtualHost with User or Group directives in it)?

In that case you cannot run the script because the directory it's stored in is world-writable, which suEXEC does not like, and no error message is shown in the error_log (as Mike pointed out, the error message you provided does not relate to the real error, but to an error presenting a correct error page to you), but in the suexec_log which most people normally do not consult.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号