2017-10-09 56 views
1

我想添加一些自定義重定向在Wordpress安裝相同的域。我想是這樣的:Wordpress 404錯誤自定義重定向.htaccess

domain.com/get/card/123456 

去:

domain.com/account/client/redirectNewCard.php?id=123456 

同樣的原理我想發生在其他2個重定向,「客戶端/驗證/電子郵件/」恩「企業/驗證/電子郵件/」。但是他們都沒有工作。

Wordpress在說404頁面時顯示「找不到頁面」,但訪問「my domain.com/account/client/redirectNewCard.php?id=123456」是否正常工作並顯示應該顯示的內容。

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 

RewriteRule ^get/card/([0-9]+)$ /account/client/redirectNewCard.php?id=$1 [R] 
RewriteRule ^client/validate/email/([0-9]+)$ /client/accountinstellingen.php?code=$1 [R] 
RewriteRule ^enterprise/validate/email/([0-9]+)$ /enterprise/instellingen.php?code=$1 [R] 

RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

我已經嘗試把重定向之前和之後的Wordpress重定向,但沒有任何這些方法的幫助。我該如何解決這個問題?

回答

1
RewriteRule ^get/card/([0-9]+)$ /account/client/redirectNewCard.php?id=$1 [R] 
RewriteRule ^client/validate/email/([0-9]+)$ /client/accountinstellingen.php?code=$1 [R] 
RewriteRule ^enterprise/validate/email/([0-9]+)$ /enterprise/instellingen.php?code=$1 [R] 

您需要包括每個這些指令的Llast)標誌。即。 [R,L]

沒有L標誌,處理將繼續進行,並可能被WordPress前端控制器重寫。您需要處理以立即停止並重定向。

+1

英雄!非常感謝!! –