Identify And Redirect To iPhone Using .htaccess

In this article, we going to see how to identify and redirect to iPhone using .htaccess. In the huge market, you target only iPhone uses to identify and redirect a particular link or page. Here is how to redirect to iPhone traffic with .htaccess.

Redirect The User To iPhone Specific Subdomain

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} iPhone
RewriteRule .* [R]

Above code will identify and redirect iPhone users to an iPhone specific subdomain ( example: ).

Redirect The User To iPhone Secific Directory

If would you like to redirect to a subdirectory of your website, ( example: ), you need to use the following code:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} iPhone
RewriteCond %{REQUEST_URI} !^/iPhone-site/ 
RewriteRule .* /iPhone-site/ [R]

Was this article helpful?

Yes No

How can we improve it?


We appreciate your helpul feedback!

Your answer will be used to improve our content. The more feedback you give us, the better our pages can be.

Follow us on social media:

Facebook Pinterest
Share via:


Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts.

Leave a Reply