Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Codeigniter 创建一个站点。当客户在域之后键入他的用户名时,我必须显示客户个人资料页面,例如“www.mydomain.com/username”。请给我一个建议。提前致谢...
$_SERVER['REQUEST_URI']将在 PHP 中保存此信息。您的 htaccess 重定向应类似于:
$_SERVER['REQUEST_URI']
RewriteRule ^([^/\.]+)/?$ /index.php?i=$1 [L]
然后在 index.php $_GET['i'] 将保存域之后 URL 中的任何值