我有我的网址从现代重写 - 重写URL
https://example.com/public/contact.php
(真实路径)
使用国防部重写改变
https://example.com/contact
。
contact
只是一个占位符,它应该与public
目录中的每个文件一起使用。像/home
或/login
我能删除这个文件extionsion:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
你这是什么意思是“改变”? '/public/contact.php'实际上是文件的真正路径,您希望通过https://example.com/contact访问它? –
是@EduardoEscobar –