0

我的网址是这样的。 http://site.org/index.php?page=tags&tag=tagname

我想将其重写为

http://site.com/tags/tagname

我当前的 .htaccess

重写引擎开启

    # RewriteRule ^/?([a-z]+)$ $1.php [L]

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-_]+)$ index.php?paste=$1 [L]

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-_]+)/edit$ index.php?paste=$1&page=edit [L]

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-_]+).txt$ index.php?paste=$1&paste_txt=$1 [L]

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-_]+).txt$ index.php?paste=$1&paste_txt=$1 [L]

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-_]+)/delete$ index.php?paste=$1&page=delete [L]

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-_]+).download$ index.php?paste=$1&paste_download=$1 [L]

    RewriteEngine on
    RewriteRule ([^/\.]+)/?.cgi$ index.php?page=$1 [L]

    #RewriteEngine on
    #RewriteRule ([^/\.]+)/?.txt$ index.php?paste_txt=$1 [L]

    #RewriteEngine on
    #RewriteRule ([^/\.]+)/?.download$ index.php?paste_download=$1 [L]
4

1 回答 1

0
RewriteRule ^/?([A-za-z0-9]+)/([A-za-z0-9]+)$ index.php?page=$1&tag=$2 [L]

我相信这应该这样做......也就是说,如果你想要标签中的数字。如果没有,请从它的每个部分中删除 0-9。

于 2013-05-28T18:16:50.073 回答