Home  >  Article  >  Backend Development  >  url 重定向,该怎么处理

url 重定向,该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:39:101056browse

url 重定向
test/year/2006/action/_add.html 如何将以上的url 重定向到以下 test.php 文件中
>>>
test.php?year=2006&action=_add

  
.htaccess该如何更改
# 将 RewriteEngine 模式打开
  RewriteEngine On

  # Rewrite 系统规则请勿修改
  RewriteRule ^archiver/((fid|tid)-[0-9]+\.html)$ archiver/index.php?$1
  RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
  RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
  RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
  RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
RewriteRule ^k/(.*)/(.*).html$ /article.php?tid=$2&dtime=$1
ErrorDocument 404 /errors/notfound.html


------解决方案--------------------
RewriteRule ^test/year/([0-9]+)/action/([a-z\-]+)\.html$ test.php?year=$1&action=$2

没有测试,看看可以不

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