首先安装apache,开启rewrite功能$a2enmodrewrite然后在/etc/apache2/apache2.conf中添加内容$nano/etc/apache2/apache2.conf内容为OptionsIndexesFollowSymLinksAllowOverrideAllRequireallgranted记得把路径设置成你网站的根目录路径!然后apachereloadserviceapache2reload到你的网站根目录添加文件为.htaccess,并在同一个.htaccess文件中添加如下内容Options-IndexesOptions+FollowSymlinksRewriteEngineonAddRewriteRule,像这样Options-IndexesOptions+FollowSymlinksRewriteEngineonRewriteRule^admin/index$admin/index.php这样,只要访问路径/admin/index,就已经访问了/admin/index.php,apache已经为你隐藏了文件扩展名https://ianakaberlin。中.c...