前言介紹
- 這款 WordPress 外掛「Page Guard Redirect」是 2017-03-20 上架。
- 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
- 上一次更新是 2022-08-22,距離現在已有 986 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.7 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
fculross |
外掛標籤
url | redirect | urlparam | query string | url parameters |
內容簡介
Page Guard Redirect(頁面守衛重定向)使用單一 URL 參數或 POST 變量作為一種提供令牌的方式,以防止訪問此外掛中放置其简码(shortcode)的任何頁面 - 當令牌不匹配預期值時可以進行重定向(另一個選項是當令牌匹配時重定向 - 也包括在其中,以獲得完整性。)
要使用的簡碼是“pgredirect”,其屬性為:
tokenparam(必填):一個字符串值,包含令牌 URL 參數的名稱 - 例如 'mytoken'(我的令牌)
tokenvalue(必填):包含 tokenparam 期望值的字符串值 - 例如 'x34ggj45b'
redirectURL(必填):包含要重定向到的 URL 的字符串值(您可以使用現有頁面作為重定向的目標 - 或者對於許多配置,將此設置為不存在的頁面將使 WordPress 重定向到默認的 404“未找到”頁面。)
redirectWhen(可選):-> 當=“1”時,在找到匹配時重定向,否則默認為在不匹配時重定向
用法示例:
在不匹配時重定向 (default) -
[pgredirect tokenparam="mytoken" tokenvalue="1234abcd" redirecturl="http://my.redirurl.com/notfound" /]
在匹配時重定向 (將 redirectwhen="1" 添加為屬性) -
[pgredirect tokenparam="mytoken" tokenvalue="1234abcd" redirectwhen="1" redirecturl="http://my.redirurl.com/notfound" /]
使用方法
一個典型的使用場景可能是防止訪問下載頁面。假設您在您的網站上使用了 PayPal 的“立即購買”按鈕,使訪問者可以支付比如電子書或音頻錄音等的款項。在設置了按鈕後,您在您 PayPal 帳戶中指定一個訪問您網站的 URL,在他們支付完毕後將返回此頁面。在這個返回頁面中,您添加了一個訪問者可以用來下載他們購買的物品的鏈結,但您不希望任何未支付的訪問者會憑空找到此頁面!
當您在 PayPal 中設置此按鈕時,在返回的 URL 的末端添加一個参数(使用任何您想要的名稱和值)例如:
"http://your.wordpress.site/download/?dltoken=Xc345Fd77"
接下來,在 WordPress 的返回頁面中添加一個 pgredirect 的簡碼 -
[pgredirect tokenparam="dltoken" tokenvalue="Xc345Fd77" redirecturl="http://your.wordpress.site/notfound" /]
如果 Page Guard Redirect 檢測到 URL 參數中缺少預期的令牌,或值與簡碼的 tokenvalue 屬性不匹配,這將導致重定向。
原文外掛簡介
Page Guard Redirect uses a single URL parameter or POST variable as a means of providing a token to guard access to any page on which this plugin’s shortcode is placed – redirection can be made to occur when the token fails to match what is expected (the alternative, i.e. redirect when token DOES match – is also included for completeness.)
The shortcode to use is ‘pgredirect’ – its attributes are:
tokenparam (required): a string value containing the name of the token URL param - e.g. 'mytoken'
tokenvalue (required): a string value containing the expected value of the tokenparam - e.g. 'x34ggj45b'
redirectURL (required): a string value containing the URL to redirect to (you can use an existing page as the target for the redirection - alternatively, for many configurations, setting this to a non existent page will make WordPress redirect to the default 404 "not found" page.)
redirectWhen (optional): -> when = "1", redirects when match is found, otherwise defaults to redirect on non-match
Syntax examples:
redirect on non match (default) -
[pgredirect tokenparam="mytoken" tokenvalue="1234abcd" redirecturl="http://my.redirurl.com/notfound" /]
redirect on match (add redirectwhen="1" as an attribute) -
[pgredirect tokenparam="mytoken" tokenvalue="1234abcd" redirectwhen="1" redirecturl="http://my.redirurl.com/notfound" /]
Usage
A typical use scenario might be to prevent access to a downloads page. Suppose you have a PayPal “Buy Now” button on your site which allows visitors to make a payment for say, an eBook or audio recording. When setting up the button in your PayPal account you specify a URL on your site to which the visitor is returned after they’ve made payment. On this return page you’ve added a link the visitor can use to download their purchase – however, you don’t want any non paying visitors to find the return page by chance!
Add a parameter to the end of the return URL (using any name and value you want) when you set up your button in PayPal e.g.
"http://your.wordpress.site/download/?dltoken=Xc345Fd77"
Next, add a pgredirect short code to your return page in WordPress –
[pgredirect tokenparam="dltoken" tokenvalue="Xc345Fd77" redirecturl="http://your.wordpress.site/notfound" /]
This will cause a redirect if Page Guard Redirect detects either the lack of the expected token in the URL parameter, or a value which doesn’t match the one in the short code’s tokenvalue attribute.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Page Guard Redirect」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Redirection 》ort, Redirection不需要Apache或Nginx知識,就可以快速簡單地建立和管理301重定向。如果您的WordPress支援永久連結,那麼您可以使用Redirection重定向任何URL...。
Page Links To 》這個外掛可以讓你將 WordPress 的頁面(或文章或自訂文章類型)連結至你選擇的 URL,而非 WordPress 的 URL。此外,它還會將前往舊的 URL(或「正常」的 URL...。
301 Redirects – Easy Redirect Manager 》301 Redirects 可協助您管理和建立301、302、307 個 WordPress 網站的重新導向,以改進 SEO 搜尋引擎優化和訪客體驗。301 Redirects 的使用非常簡單,是新站...。
Custom Permalinks 》name or slug), add the filter that looks like this:, function yasglobal_exclude_posts( $post ) {, // Replace '2' with ID of the post you want to ...。
Redirection 》在您的免費測試網站上試試看:點擊這裡 => https://tastewp.com/plugins/redirect-redirection。, (這個技巧適用於 WP 插件庫中的所有插件 - 只需在 URL ...。
Quick Page/Post Redirect Plugin 》目前版本為 5.2.3, 這個外掛有兩個重定向功能 - "快速重定向" 和 "個別重定向":, 快速重定向 (301 重定向), 快速重定向被設計為快速而簡單的加入。你不需要設...。
WP 404 Auto Redirect to Similar Post 》歡迎使用 WP 404 Auto Redirect to Similar Post!本外掛會根據標題、文章類型及分類來自動將 404 頁面重新導向至類似文章。如果找不到類似文章,訪客會被重...。
Attachment Pages Redirect 》這個外掛有三種可能的情境下會執行功能。無論哪種情況,該附件頁面必須存在,若該附件已被刪除,此外掛不會運作:, A)訪客進入附件頁面,其上層文章仍然存在...。
All 404 Pages Redirect to Homepage 》這個外掛可將所有404頁面重新導向到首頁或任何自定義頁面,避免這些404 URL對搜索引擎索引產生負面影響。此外掛使用 SEO 301 重定向方式,以符合 SEO 標準,...。
Shortcode Redirect 》這款「Shortcode Redirect」外掛讓網站擁有者在網站的頁面或文章上查看特定的秒數之後,自動將使用者重新導向到其他網站。外掛的使用方式非常簡單,只需在貼...。
SEO Redirection Plugin – 301 Redirect Manager 》SEO Redirection 是一個強大的重定向管理器,可輕鬆管理 301 重定向,您可以輕鬆地為您的網站建立和管理重定向。, 如果您想從舊網站遷移頁面或更改 WordPress...。
Redirect 404 Error Page to Homepage or Custom Page with Logs 》這個外掛可以輕鬆地將 WordPress 的 404 錯誤頁面導向至首頁或其他頁面。這個外掛支援永久重定向(HTTP 回應狀態碼 301)和暫時重定向(HTTP 回應狀態碼 302...。
One Click SSL 》這是一個簡單易用的 WordPress SSL 外掛程式,可將所有非 SSL 頁面重新導向到 SSL,同時確保在 SSL 頁面上載入的所有資源也都使用 SSL 載入。, 啟用後,它會...。
Multiple Domain 》重要提示:此外掛現在有新的維護者,因此將重新啟動開發工作,並成為 goINPUT 的一部分。, Multiple Domain 允許您在單一 WordPress 安裝中擁有多個網域。此...。
Contact Form 7 – Success Page Redirects 》這是一個針對 Contact Form 7(CF7)的附加外掛,提供了一種簡單的方法,讓訪客在成功傳送訊息後,能夠自動重新導向到成功頁面或感謝頁面。如果沒有傳送訊息...。