标签: php url routing
建立一个获得#39;哈希的网络服务,目前:
http://example.com/?hash=123abc
我想将其更改为以下格式:
http://example.com/123abc
这项技术的名称是什么?
谢谢!
答案 0 :(得分:1)
它被称为URL重写。您可以阅读here和here。
答案 1 :(得分:1)
创建新的.htaccess文件和内容:
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^(A-Za-z0-9-)?$ index.php?hash=$1 [L] </IfModule>