>  기사  >  백엔드 개발  >  url 重定向,该怎么处理

url 重定向,该怎么处理

WBOY
WBOY원래의
2016-06-13 13:39:101054검색

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

没有测试,看看可以不

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.