2014-09-24 54 views
2

我们最近将2个网站移至完整SSL,因为我们知道Google对安全网站的评级更高。但已经过了两个月了,我们的网站没有被索引为SSL。.htaccess 301 https://未重定向到https://未被Google索引

例如;

在我们的Joomla网站上放置ssl的一个星期内,我们所有的网址都在https中改为https://这就是我们想要的 - 这是因为我们在Joomla htaccess中设置了301重定向。

但是在我们的Opencart网站上有一个不同配置的htaccess文件,它仍然只在Google上显示非SSL结果。 SSL在我们的网站上正常运行,并且自Google以来已被抓取数十次,但由于某些原因,Google不会将我们作为https网站编入索引。

我想在我们的htaccess中没有设置正确的301重定向。我已在下面附上它:

#gzip starts 
<ifModule mod_deflate.c> 
<filesMatch "\.(js|css|txt|woff)$"> 
SetOutputFilter DEFLATE 
</filesMatch> 
</ifModule> 

#cache starts 
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf|woff|txt)$"> 
<IfModule mod_expires.c> 
ExpiresActive on 

ExpiresDefault "access plus 14 days" 
</IfModule> 
Header unset ETag 
FileETag None 
</FilesMatch> 

#domain rewrite starts 
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC] 
RewriteRule^http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.gomobility.ie/$1 [R=301,L] 


# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess. 

# For any support issues please visit: http://www.opencart.com 

Options +FollowSymlinks 

# Prevent Directoy listing 
Options -Indexes 

# Prevent Direct Access to files 
<FilesMatch "\.(tpl|ini|log)"> 
Order deny,allow 
Deny from all 
</FilesMatch> 

# SEO URL Settings 
RewriteEngine On 
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie./becomes /shop/ 

RewriteBase/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] 
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] 
RewriteRule ^download/(.*) /index.php?route=error/not_found [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) 
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] 

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it. 
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that. 

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it: 
# php_flag register_globals off 

# 2. If your cart has magic quotes enabled, This may work to disable it: 
# php_flag magic_quotes_gpc Off 

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try 
# php_value upload_max_filesize 999M 

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value post_max_size 999M 

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value max_execution_time 200 

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields 
# php_value max_input_time 200 

# 7. disable open_basedir limitations 
# php_admin_value open_basedir none 

任何帮助,真的不胜感激。

+0

埃姆,使网站通过SSL只是在谷歌较高的排名?我很好奇目前的* SEO/SEM政治*会导致哪些...换句话说:看起来像任何你可以支付的服务将会*帮助你的网站排名更高* - 或换句话说 - 如果你想要排名更高,你将需要购买任何可用的服务... – shadyyx 2014-09-24 09:23:19

+0

阅读[这篇短文]下的推文(http://searchengineland.com/seo-industry-tweets-reactions-googles-ssl-ranking-boost- 199510),这可以使你的一天 - 使我确信:-) – shadyyx 2014-09-24 09:26:05

+0

这个问题似乎是脱离主题,因为它是关于[webmasters.se] – hjpotter92 2014-09-24 09:32:51

回答

1

您的规范标签是http版本,我会将其更改为https以避免发送冲突信号。

+0

感谢您的答复,你的意思是在htaccess的设置,有一些这样做与规范链接?或者你的意思是显示在网页源代码中的规范? – user3566506 2014-09-24 19:30:17

+0

源代码中的规范是错误的,它们是指http版本而不是https。查看源代码,你会看到。 – user29671 2014-09-25 04:08:49

2

您的规范链接仍然不是ssl。 OpenCart生成规范链接(查看源代码)。这些链接是通过OpenCart生成的,不会受到你的htaccess的影响。

有几种方法可以改变这一点。首先,你可以找到你调用链接函数的每个实例,并添加SSL作为第三个参数。

替换此:

$this->url->link('example/path'); 

有了这个:

$this->url->link('example/path', '', 'SSL'); 

或者你可以更改链接功能可按来处理所有的链接,在默认情况下SSL链接。转到system/library/url.php并更改这一行。

public function link($route, $args = '', $connection = 'NONSSL') { 

要这样:

public function link($route, $args = '', $connection = 'SSL') {