[英]Is it possible to redirect the example.com/index.php?page=abc to example.com/abc?
[英]Is “example.com/index.php/page/about/” good practice?
通常,人们会发现该URL是“ example.com/index.php?page=about”或更佳的是“ example.com/page/about/”。 但是在这种情况下,它是“ example.com/index.php/page/about/”。 注意中间的index.php。
问题:
谢谢大家的耐心配合。 一般来说,我是Web开发的新手。
我不太确定您要问的是什么,但是:“ example.com/index.php?page=about”是很正常的“页面”,它是index.php可用的get变量。 http://php.net/manual/en/reserved.variables.get.php您可以从用户视图中删除变量,或者仅使用POST而不是GET。
如果您确实想要(但不应该)从$ _SERVER ['REQUEST_URI']解析出您需要的内容,则可以使用精确的URL进行各种技巧,例如example.com/index.php/page / about或example.com/page/about引回index.php。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.