的.htaccess - pretty的用户配置文件的URL [英] .htaccess - Pretty User Profile URLs

查看:188
本文介绍了的.htaccess - pretty的用户配置文件的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让我的用户配置文件pretty的,因为它是。这里是正规网址:

I want to make my user profiles 'pretty' as it were. Here is the regular URL:

user.php的?USER =用户名

user.php?user=UserName

我希望这成为:

用户/用户名

请帮忙:)我是个新手的.htaccess

Please help :) Im a .htaccess newbie.

推荐答案

请尝试以下指令:

RewriteEngine on
RewriteRule ^user/([^/]+)$ user.php?user=$1 [L,QSA]

此规则重写与形式的URL路径的任何请求/用户/ foobar的 内部以 /user.php?user = foobar的 的。

This rule rewrites any request with a URL path of the form /user/foobar internally to /user.php?user=foobar.

这篇关于的.htaccess - pretty的用户配置文件的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆