Hello,
Short answer: There is no way to achieve the purpose using this plugin.
Long answer: Yes, you can achieve the purpose using one of the alternatives…
1. If you have only one redirect… this can be achieved easily using a simple redirect in the server. All major web servers allow us to redirect based on the user-agent string in the request header. For example, in Nginx, you can insert an additional line like the following…
?if ( $http_user_agent = "My Embedded Browser" ) { return /new-url/; }
You may know more about return statement in Nginx at https://nginx.org/r/return .
2. If you have multiple redirects (like more than 100)… this can be achieved using a combination of server-side tweaks and a WP plugin to redirect based on the user-agent. Most web servers serve cached content for most requests without hitting PHP / WP. So, the first step is to let the web server to skip the cache and pass the request to PHP/WP. For example, in Nginx, you can achieve this with a bit of a hack used in the following code…
location / {
error_page 418 = @cachemiss;
?if ( $http_user_agent = "My Embedded Browser" ) { return 418; }
# other directives to process requests from other user-agents.
}
location @cachemiss {
try_files $uri $uri/ /index.php$is_args$args;
}
You can see a real-time example of how this technique is used for WP Super Cache plugin at https://github.com/pothi/wordpress-nginx/blob/master/globals/wp-super-cache.conf .
Once, you instructed the web server to skip the cache for your specific user-agent, the next step is to let WP to handle all the redirects. This is bit easy to achieve using an existing plugin such as https://www.ads-software.com/plugins/redirection/ or using your own custom plugin.
I hope that helps.
-
This reply was modified 5 years, 7 months ago by Pothi Kalimuthu. Reason: fixed formatting of code block and fixed a typo