Htaccess文件夹重写和显示索引从文件夹


htaccess folder rewrite and show index from folder

我想把我的url: http://domain.com/administration重写为domain.com/admin

但是当我使用http://domain.com/admin/

时,该子目录的index.html不可用

我怎样才能解决这个问题?

这是我的htaccess:
RewriteEngine On
RewriteRule ^([^'.]+)$ $1.php [NC,L]
RewriteRule ^admin/(.*) administration/$1.php

试试这些。您可能需要外部的管理工作,如您所愿。

# fix missing trailing / on admin
RewriteRule ^admin$ /admin/ [NS,L,R=301]
# change admin dir
RewriteRule ^admin/(.*) administration/$1 [NS,DPI]
# load anything that's not a directory as php
RewriteRule ^(?>[^.]+)(?<!/)$ $0.php [NS,L]