apache - .htaccess redirrect to mobile site for multiple domains -


i have dev, staging , prod site using dev.examtest.com staging.example.com , example.com. trying create redirect using .htaccess work 3. using git keep 3 environments in sync , because of need apply 3. below have prod. in each environment edit last line work. there way have 1 set of code work 3?

rewritecond %{request_uri} ^/$ rewritecond %{http_user_agent} "android|blackberry|googlebot mobile|iemobile|iphone|ipod|opera mobile|palmos|webos" [nc] rewritecond %{http_cookie} !is_splash_visited=1 [nc] rewriterule ^(.*)$ https://example.com/mobile/$1 [r,l] 

change example.com use %{http_host}:

rewritecond %{request_uri} ^/$ rewritecond %{http_user_agent} "android|blackberry|googlebot mobile|iemobile|iphone|ipod|opera mobile|palmos|webos" [nc] rewritecond %{http_cookie} !is_splash_visited=1 [nc] rewriterule ^(.*)$ https://%{http_host}/mobile/$1 [r,l] 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -