htaccess的重写URL没有显示是否正确? [英] .htaccess rewrite URL not showing correctly?

查看:213
本文介绍了htaccess的重写URL没有显示是否正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想它,当我写了以下内容:

I want it so when I write the following:

http://boundsblazer.com/user/joe

在内部处理页面:

http://boundsblazer.com/user/profile?usr=joe

但保留旧的URL。 然而,当我写的:

But keeps the old URL. However, when I write:

http://boundsblazer.com/user/joe

网址变为:

http://boundsblazer.com/user/profile?usr=joe

我寻觅了无数的线程,没有人是有我的麻烦。问题是,当我写我的网址,网址变化,使它看起来难看。这是我的的.htaccess:

I have searched countless threads, and nobody is having the trouble I am. The problem is that when I write my URL, the URL changes and makes it look ugly. This is my .htaccess:

RewriteEngine on
RewriteRule ^user/([a-zA-Z0-9]+)$ http://boundsblazer.com/user/profile.php?usr=$1 [L,QSA]

有谁知道这可能是导致这个问题?

Does anyone know what could be causing the problem?

推荐答案

使用这样的:

RewriteEngine on
RewriteRule ^user/([a-zA-Z0-9]+)$ /user/profile.php?usr=$1 [L,QSA]

的问题是,你正在使用的不是相对URL的绝对URL,以及mod_rewrite并进行重写的重定向代替。

The issue is that you are using an absolute URL, instead of a relative URL, and mod_rewrite is performing a redirect instead of a rewrite.

这篇关于htaccess的重写URL没有显示是否正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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