2013-05-28 89 views
0

我的網址是這樣的。 http://site.org/index.php?page=tags&tag=tagname國防部重寫標籤

我想它重寫

http://site.com/tags/tagname

我目前的.htaccess

RewriteEngine敘述在

# 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] 

回答

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

我相信這應該這樣做。這就是如果你想要數字在你的標籤。如果沒有,請從每個部分刪除0-9。

+0

地獄耶夥計,工作。謝謝;玩了一段時間,我無法得到它。我用mod_rewrite不太好。 – user2186257

+0

我可以做些什麼來允許空格? – user2186257

+0

給予答案一個投票,所以它可能會幫助有人在未來尋找它:) – juanschwartz