htaccess停止自动重定向到未知文件夹

时间:2018-04-09 15:41:15

标签: php .htaccess

我正在使用htaccess来重定向我的网址并隐藏.PHP扩展名,但是在我使用的代码之后它会转到一个未知的文件夹


    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule ^index$ index.php [L]

重定向时显示以下错误


    Not Found
    The requested URL /abc/index was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

我的网站名称与abc.com类似,但它显示上述错误,包含未知文件夹/ abc / index

0 个答案:

没有答案