mardi 28 avril 2015

All Google search result urls pointing to mobile home page

I have gone through most articles here and finding no joy. My situation is as follows

  • I have main website with its htaccess file
php_value display_errors 0
php_value error_reporting 30719
php_flag display_errors off

RewriteEngine On

#without www
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#with www
#RewriteCond %{HTTP_HOST} ^(?!www\.)(.+)
#RewriteRule ^(.*) http://www.%1/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ./index.php

<Files *.ini>
        order deny,allow
        deny from all
</Files>

#RewriteCond %{HTTP_USER_AGENT} Android|Blackberry|iPad|iPhone|ipod|iemobile|opera\ mobile|palmos|webos|googlebot-mobile
#RewriteCond %{REQUEST_URI} !^/mobile/
#RewriteRule .* /mobile/ [R]

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

<IfModule mod_deflate.c>
#The following line is enough for .js and .css
AddOutputFilter DEFLATE js css
AddOutputFilterByType DEFLATE text/plain text/xml application/xhtml+xml text/css application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp text/html
 
#The following lines are to avoid bugs with some browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent env=!dont-vary
</IfModule>
 
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A300
#set catche for one month
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType text/x-javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType application/x-shockwave-flash A2592000
</IfModule>
## EXPIRES CACHING ##

## EXPIRES CACHING ##
 <IfModule mod_headers.c>
Header append Vary User-Agent
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(bmp|css|flv|gif|ico|jpg|jpeg|js|pdf|png|svg|swf|tif|tiff)$">
        Header set Last-Modified "Mon, 31 Aug 2009 00:00:00 GMT"
</FilesMatch>

<FilesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public" 
</FilesMatch>
<FilesMatch "\.(css)$">
Header set Cache-Control "public"
</FilesMatch>
<FilesMatch "\.(js)$">
Header set Cache-Control "private"
</FilesMatch>
<FilesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</FilesMatch>
</IfModule>

<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>

Header unset ETag
FileETag None
<ifModule mod_headers.c>
Header unset Last-Modified
</ifModule>
  • I have a mobile website with files in /mobile directory with htaccess as well
RewriteEngine On

#without www
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#with www
#RewriteCond %{HTTP_HOST} ^(?!www\.)(.+)
#RewriteRule ^(.*) http://www.%1/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ./index.php

<Files *.ini>
        order deny,allow
        deny from all
</Files>

Questions - Currently when i open a google search result url, they all point to the mobile site home page instead of the mobile version of the url. Please help

Aucun commentaire:

Enregistrer un commentaire