Created — forked from aarongustafson/.htaccess

An example of how Costco could redirect mobile requests properly

  • Download Gist
1 2 3 4 5 6 7 8 9 10
# setup
RewriteEngine on
RewriteBase /
# product redirection based on iPhone and product request
# note: the user agent check is contrived, you should have
# a much more robust checker
RewriteCond %{HTTP_USER_AGENT} iPhone
RewriteCond %{QUERY_STRING} Prodid=(\d+)
RewriteRule ^Browse\/Product\.aspx [R=301,L]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.