title: .htaccess add tablet redirect
body: <p>Using the .htaccess file, I wish to redirect tablet traffic to a tablet optimised site. </p>
  
  <p>Regular URL: waxxxed.com.au
  Tablet Optimised URL: waxxxed.com.au/tablet/</p>
  
  <p>I've tried the following code but it doesn't work.</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} ipad [NC]
  RewriteCond %{HTTP_HOST} !^ipad\. [NC]
  RewriteRule ^ http://waxxxed.com.au/tablet/ [L,R=301]
  </code></pre>
  
  <p>x3 questions...</p>
  
  <ol>
  <li>This code doesn't work. Appears to create a loop. Not sure, but that may be related to my existing .htaccess code provided below.</li>
  <li>I want to redirect ALL tablets (not mobiles) not just iPads. How do I capture other tablet brands?</li>
  <li>Can you recommend any further optimisation of my .htaccess coding.</li>
  </ol>
  
  <p>Full current .htaccess file (it works!)...</p>
  
  <pre><code>&lt;IfModule mod_expires.c&gt;
  # Enable cache expirations
  ExpiresActive On
  # Default directive
  ExpiresDefault "access plus 1 month"
  # My favicon
  ExpiresByType image/x-icon "access plus 1 year”
  &lt;/IfModule&gt;
  
  # force redirect of html to no-extension
  RewriteCond %{THE_REQUEST} ^GET\s.+\.html
  RewriteRule ^(([^/]+/)*[^/.]+)\.html$ http://waxxxed.com.au/$1 [R=301,L]
  
  # www to non-www
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www.waxxxed.com.au
  RewriteRule (.*) http://waxxxed.com.au/$1 [R=301,L]
  
  # Redirect from / to non-/
  RewriteEngine On
  RewriteRule ^(.*)/$ $1 [R=301,NC,L]
  
  # parse file as file.html
  RewriteCond %{REQUEST_FILENAME}\.html -f 
  RewriteRule ^(([^/]+/)*[^/.]+)$ $1.html [L] 
  
  # refer not found content to 404 page
  ErrorDocument 404 /404page.html
  </code></pre>