内部服务器错误 - > .htaccess中的RewriteRule

时间:2021-10-13 10:38:53

i'm getting Internal Server Error with this .htaccess file:

我正在使用此.htaccess文件获取内部服务器错误:

Allow from all

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On

    # Important: RewriteBase
    # If you installed the web app in a sub-directory you have to set this accordingly.
    # Note: No trailing slash! (f.e. /BoNeMEAL or /mc-server/ban-management)
    RewriteBase /home/webpages/lima-city/townville/bans

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Hope someone can help me.

希望可以有人帮帮我。

1 个解决方案

#1


RewriteBase must contain path from server root (dir pointed by www.example.com) to dir where .htaccess placed (in this case). So if your server root at /home/webpages/lima-city/townville/bans then say

RewriteBase必须包含从服务器根目录(由www.example.com指向的dir)到.htaccess放置的dir(在本例中)的路径。所以如果您的服务器根目录在/ home / webpages / lima-city / townville / bans然后说

RewriteBase /

#1


RewriteBase must contain path from server root (dir pointed by www.example.com) to dir where .htaccess placed (in this case). So if your server root at /home/webpages/lima-city/townville/bans then say

RewriteBase必须包含从服务器根目录(由www.example.com指向的dir)到.htaccess放置的dir(在本例中)的路径。所以如果您的服务器根目录在/ home / webpages / lima-city / townville / bans然后说

RewriteBase /

相关文章