gpt4 book ai didi

php - 如何实现像 www.example.com/username 这样的 url 以重定向到 www.example.com/user/profile.php?uid=10?

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:06:26 25 4
gpt4 key购买 nike

<分区>

在我的网站上,可以通过 url www.example.com/user/profile.php?uid=3 访问用户配置文件我想让用户通过简单地请求 www.example.com/username

来更轻松地访问他们的个人资料

每个用户都有一个不能更改的用户名。我怎样才能做到这一点?

Here is my current .htaccess file

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
# If the request is not for a valid link
RewriteCond %{REQUEST_FILENAME} !-l
# finally this is your rewrite rule
RewriteRule ^blog/(.+)$ blog.php/$1 [L,NC]
RewriteRule ^(.+)$ user_page/profile.php?uid=$1 [L,QSA]

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com