.htaccess h移除';指数';在url的最后一部分(不是index.php)

.htaccess h移除';指数';在url的最后一部分(不是index.php),.htaccess,laravel,indexing,.htaccess,Laravel,Indexing,我的重写权限有问题。我已经在本地主机上使用了htaccess,它可以正常工作。但为什么在我的网站上失败了呢 这是我的密码 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule api/(.*)/(.*)$ api/$1.php?request=$2 [QSA,NC,L] </IfMo

我的重写权限有问题。我已经在本地主机上使用了htaccess,它可以正常工作。但为什么在我的网站上失败了呢

这是我的密码

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule api/(.*)/(.*)$ api/$1.php?request=$2 [QSA,NC,L]
</IfModule>

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

RewriteEngine On

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

# Handle Index...
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index($|\ |\?)
RewriteRule ^ /%1 [R=301,L]

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则api/(.*)/(.*)$api/$1.php?请求=$2[QSA,NC,L]
选项-多视图
重新启动发动机
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
#句柄索引。。。
重写cond%{u请求}^[A-Z]{3,9}\/(.*)索引($\\\\\\?)
重写规则^/%1[R=301,L]

我尝试访问
http://www.mywebsite.com/admin/index
http://www.mywebsite.com/admin/index/
而且上面说找不到页面。。我只想删除url最后一部分的索引
http://www.mywebsite.com/admin/
我在本地主机上使用了htaccess代码,这是成功的。。为什么在我的服务器上失败

非常感谢

请这样做:

Options -MultiViews
RewriteEngine On

# Handle Index...
RewriteCond %{THE_REQUEST} /index[?\s] [NC]
RewriteRule ^(.*?)index$ /$1 [L,R=302,NC,NE]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

RewriteRule ^api/([^/]+)/(.*)$ api/$1.php?request=$2 [QSA,NC,L]

# Handle Front Controller...
RewriteRule ^ index.php [L]