热搜:NVER node 开发 php

htaccess 伪静态跳转问题

2024-09-16 17:00:02
htaccess 伪静态跳转问题

php 

想从tag/abc 跳到 tag/index.php?t=abc



RewriteRule ^tag/(.*)$ tag/index.php?t=$1

index.php
print_r($_GET['t']);//显示的是index.php 而不是 abc 怎么办??



回复讨论(解决方案)

RewriteRule ^tag/(?!index\.php)(.*)$ tag/index.php?t=$1

RewriteRule ^tag/(?!index\.php)(.*)$ tag/index.php?t=$1

给力啊,解决了~
伪静态里重复(循环)跳转是个隐晦误点