如何在.htaccess中用一行代码隐藏php扩展
我想问的是,不要在.htaccess中写很多行,包括隐藏扩展名的所有页面如何在.htaccess中用一行代码隐藏php扩展,php,.htaccess,hide,file-extension,Php,.htaccess,Hide,File Extension,我想问的是,不要在.htaccess中写很多行,包括隐藏扩展名的所有页面 RewriteRule^about$about.php[L] 重写规则^register$register.php[L] 重写规则^login$login.php[L] 重写规则^dashboard$dashboard.php[L] 重写规则^logout$logout.php[L] 是否有任何单行代码可以执行相同的操作?嗨,Laurenz Albe,您对我的问题有何修改?您只删除了“提前谢谢”文本?是否有必要删除该部分
RewriteRule^about$about.php[L]
重写规则^register$register.php[L]
重写规则^login$login.php[L]
重写规则^dashboard$dashboard.php[L]
重写规则^logout$logout.php[L]
是否有任何单行代码可以执行相同的操作?嗨,Laurenz Albe,您对我的问题有何修改?您只删除了“提前谢谢”文本?是否有必要删除该部分?我只是想学习。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]