2012-09-17 107 views
1

目前我有一個PHP頁面,並與htaccess我正在改變頁面的URL。這是我的.htaccess:

RewriteEngine On 
RewriteRule ^customer/edit/(.*)/deletefrom/(.*)/ index.php?page=customer&edit=$1&deletefrom&=$2 [QSA,L] 

當我試圖從$_GET['deletefrom']我得到一個空值的值。但$_GET['edit']正在工作,並給出了一個值,所以這很奇怪。我希望有人能幫助我。

回答

3
RewriteEngine On 
RewriteRule ^customer/edit/(.*)/deletefrom/(.*)/ index.php?page=customer&edit=$1&deletefrom&=$2 [QSA,L] 

&用作GET參數分隔符,deletefrom後開創&所以你得到空值。而不是上述代碼使用以下

RewriteEngine On 
RewriteRule ^customer/edit/(.*)/deletefrom/(.*)/ index.php?page=customer&edit=$1&deletefrom=$2& [QSA,L] 
+0

哇,我現在感覺真的很愚蠢。一直在網上尋找一個小時。謝謝。 – Marnix

+0

歡迎@Marnix :) – Poonam

2

你有一個&之後deletefrom變量。