wordpress - Redirect request based on user agent -
i need redirect user based on useragent.
currently wordpress site using ajax based theme. url format is
http://www.example.com/#!/my_first_post/ my current htaccess code follows.
# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress this need do:
if (user agent == "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" ){ redirect url without hashes ex:http://www.example.com/my_first_post/ } i need using htaccess. please me.
there's mod_rewrite variable detect user-agents:
rewritecond %{http_user_agent} facebookexternalhit/1\.1 [nc] but it's not going you. there no way can match url fragment in htaccess file because fragment is never sent server. url fragments on client side, you're best bet add modifications theme user agent check , have not use fragments if it's facebook.
Comments
Post a Comment