.htaccess文件提供500内部服务器错误

时间:2014-11-05 18:22:57

标签: .htaccess internal-server-error

伙计我正在开发一个项目并在本地服务器上使用以下.htaccess代码,它给我500个内部错误 我尝试修改代码但仍无法找到解决方案 因为我已经评论了这些行,但仍然没有结果

# Comment the 2 lines below if the server returns 500 errors!
# Options -Indexes
# Options +FollowSymLinks

#Uncomment following lines if you want to use image caching!
#<IfModule mod_expires.c>
#  ExpiresActive On
#  ExpiresDefault A1209600
#  ExpiresByType text/html A1
#</IfModule>

# Uncomment following lines if Apache doesnt support MultiViews!
<IfModule mod_rewrite.c>
    RewriteEngine On

    # Uncomment the 2 lines below if you are using www.domain.com
    # as the baseurl for the site and users access your site 
    # via domain.com (THIS IS REQUIRED FOR JQUERY TO WORK)

    #RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
    #RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301] 

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* loader.php [L,QSA]
</IfModule>

# Edit below lines and set to
# ErrorDocument CODE /RELATIVE/error.php
# If the script is installed in the default document
# root then relative is null.
#ErrorDocument 401 /error.php
#ErrorDocument 403 /error.php
#ErrorDocument 404 /error.php

AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|</body>| <script type=\"text/javascript\">     var loc = ((\"https:\" == document.location.protocol) ? \"https://analytics.\" : \"http://analytics.\");     document.write(unescape(\"%3Cscript src='\" + loc + \"sitewit.com/v3/931271415/sw.js' type='text/javascript'%3E%3C/script%3E\")); </script>   </body>|ni"

1 个答案:

答案 0 :(得分:0)

您正在重写整个URI。所以

http://example.com/test

变为

loader.php