url 重写如何工作? [英] How does url rewrite works?

查看:13
本文介绍了url 重写如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

web server如何实现url重写机制,改变浏览器地址栏?
我不是在询问配置 apache、nginx、lighthttpd 或其他的具体信息!
我想知道当服务器要重写url时,向客户端发送了什么样的信息?

How does web server implements url rewrite mechanism and changes the address bar of browsers?
I'm not asking specific information to configure apache, nginx, lighthttpd or other!
I would like to know what kind of information is sent to clients when servers want rewrite url?

推荐答案

您是在谈论服务器端重写(如 Apache mod-rewrite)吗?对于那些,地址栏通常不会改变(除非执行重定向).或者你在谈论重定向?这些是通过让服务器使用 HTTP 代码(301、302 或 307)和 HTTP 标头中的位置进行响应来完成的.

Are you talking about server-side rewrites (like Apache mod-rewrite)? For those, the address bar does not generally change (unless a redirection is performed). Or are you talking about redirections? These are done by having the server respond with an HTTP code (301, 302 or 307) and the location in the HTTP header.

这篇关于url 重写如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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