gpt4 book ai didi

.htaccess 301 http ://redirect to https://not being indexed by Google

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:29:16 25 4
gpt4 key购买 nike

我们最近将 2 个网站迁移到完整的 SSL,因为我们知道 Google 在安全网站方面排名更高。但是两个多月过去了,我们的网站还没有被编入 SSL 索引。

例如;

在我们的 Joomla 网站上放置 ssl 一周内,我们所有的 url 在 Google 中都已更改为 https://,这正是我们想要的 - 这是因为我们在 Joomla htaccess 中设置了 301 重定向。

但是在我们的 Opencart 网站上,它有一个不同配置的 htaccess 文件,它仍然只在谷歌上显示非 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

我们将不胜感激任何帮助。

最佳答案

您的规范链接仍然不是 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') {

关于.htaccess 301 http ://redirect to https://not being indexed by Google,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26012954/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com