S
S
Sergey2015-09-22 21:25:35
Mobile development
Sergey, 2015-09-22 21:25:35

How to setup .htaccess file to redirect user from site.com to site.com/mobile?

Apache server. I write the following in the .htaccess configuration file:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} data taken from detectmobilebrowsers.com [NC,OR]
RewriteCond %{HTTP_HOST} ^.*$
RewriteCond %{REQUEST_URI} !mobile/
RewriteRule ^(.*)$ mobile/$1 [L, R=302]
This results in the error "The server encountered an internal error or misconfiguration and was unable to complete your request".
I tried many different options with a slightly different syntax that I managed to find on the net (I myself am a complete layman) - all in vain. Where is the mistake? Help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentine, 2015-09-22
@SergeiB

What's wrong with detectmobilebrowsers.com/download/apache ?
Is the rewrite module enabled in apache ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question