我有 2 个版本的网站、桌面版和手机版:
我的 htacces 正在将移动设备重定向到移动版本。
问题... _
1-如果访问者来自谷歌,因为他搜索了“东西”,完整链接显示为“www.olivashot.com/index.php/thing”,它重定向到“www.mobile.olivashot.com/index .php/thing"(我有一个快乐的访客)
2-但如果谷歌中的链接是:“www.olivashot.com/thing”>>>他被重定向到“www.mobile.olivashot.com”(我失去了一个访问者,因为我没有展示他的内容预期的)
我认为这是因为我正在重写“某事”以退出 joomla 网站中的默认“index.php”
RewriteBase /
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ http://www.mobile.olivashot.com/$1/ [R=301,L]