如何使我的网站登录表单页面是"/login“而不是"/login.php”或"/login.html“的Id像我的网站只显示目录”/login“。任何回复和提示都会得到很好的接收。谢谢。
发布于 2017-05-19 07:29:22
一个简单的解决方案是将您的“登录”重命名为"index.php“,并将其放在自己的名为"login.php”的文件夹中。
发布于 2017-05-19 07:28:05
发布于 2017-05-19 07:32:38
我用.htaccess实现了这一点--这允许http://exmaple.com/whatever.php被看作是简单的http://example.com/whatever
Options -MultiViews
RewriteEngine on
# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
# add php if possible
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]
# rewrite other to index.php file
RewriteRule ^ /index.php [L]https://stackoverflow.com/questions/44059205
复制相似问题