我不知道是否有可能在.htcaccess文件中編碼,並使其重定向/重寫到外部URL。這是一個Joomla網站。如何使用.htcaccess將僅針對移動瀏覽器的特定頁面重寫/重定向到外部URL?
我想要的是與移動設備遊人如手機或平板電腦應該當他們訪問此頁面重定向: http://www.axima.se/index.php/nytt-a-begagnat/sok-begagnade-maskiner
這是我希望他們能夠被引導到網址: http://m.dealers.mascus.com/Axima
我發現這個線程,並用它爲靈感,嘗試了一些代碼組合,但我不是能夠把正確的代碼一起 Redirecting only a specific page request for mobile users using htaccess
這段代碼是從舊約她的線程(一個WordPress站點)和林不知道,以保持並在那裏把我的代碼:
# BEGIN Mobile redirect for the video
<IfModule mod_rewrite.c>
RewriteEngine On
# stuff to let through (ignore)
RewriteRule ^mobile/ - [L]
# redirect /video.html to /mobile/index.html for mobile browsers
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^video\.html$ /mobile/index.html [L,R=302]
</IfModule>
# END Mobile redirect
的Joomla已經具有檢測移動的能力。爲什麼要包含並維護另一個額外的類 –
好吧,聽起來很合理,你可以提供關於如何使用joomla的代碼做到這一點的線索嗎? – amitgur
看到我的答案,讓我知道它是如何爲你工作的。 –