-2

例: https://int.theqtl.com/test/t1.php?id=2 に変更

https://int.theqtl.com/test/t1.php

4

1 に答える 1

0

私はこれを使用します.htaccess

RewriteEngine On 
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([\(\)\|a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$   /index.php?ext=$1&cat=$2&name=$3&sub1=$4&sub2=$5&sub3=$6&sub4=$7&sub5=$8 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([\(\)\|a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$    /index.php?ext=$1&cat=$2&name=$3&sub1=$4&sub2=$5&sub3=$6&sub4=$7 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([\(\)\|a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$ /index.php?ext=$1&cat=$2&name=$3&sub1=$4&sub2=$5&sub3=$6 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([\(\)\|a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$  /index.php?ext=$1&cat=$2&name=$3&sub1=$4&sub2=$5 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([\(\)\|a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$   /index.php?ext=$1&cat=$2&name=$3&sub1=$4 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([\(\)\|a-zA-Z0-9_-]+)/?$     /index.php?ext=$1&cat=$2&name=$3 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$    /index.php?ext=$1&cat=$2 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/?$     /index.php?ext=$1 [L]  

そして、$_GET['ext']; これの代わりに、 a タグのリンクを引き続き使用できます。

<a href="www.site.com/index.php?do=true?when=now" >do stuf</a>

次のようになりますか?

<a href="www.site.com/true/now" >do stuf</a>
于 2012-10-11T11:50:21.497 に答える