Home >Backend Development >PHP Tutorial >URL地址301重定向解决方案

URL地址301重定向解决方案

WBOY
WBOYOriginal
2016-06-13 12:18:401374browse

URL地址301重定向
请问如何将下面的地址通过PHP 301永久重定向呢?
http://www.xxxx.com/guang/123456
重定向为http://www.xxxx.com/deal/123456

http://www.xxxx.com/index/cate/cid/1
重定向为http://www.xxxx.com/list/1
------解决思路----------------------
试试

<br />rewrite ^/guang(.*) /deal$1 last;<br />rewrite ^/index/cate/cid(.*) /list$1 last;<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn