0

这是我的重写代码:

## File Security
<FilesMatch "\.(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *

#### Rewrite rules for SEO functionality ####

<IfModule mod_rewrite.c>
RewriteEngine On

#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.genyx.co.uk/$1 [R,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA]

</IfModule>

但它不适用于 SSL 页面,例如:

http://www.genyx.co.uk/terms-and-conditions.html

https://www.genyx.co.uk/terms-and-conditions.html

有人可以帮我让它工作吗?

4

2 回答 2

3

编辑:

http://www.genyx.co.uk/ -> 显示一些内容

https://www.genyx.co.uk/ -> 显示默认的 Apache 站点“它可以工作!”

所以 SSL 服务器有不同的 DocumentRoot。如果您更改它,它应该可以按预期工作。

顺便说一下,请检查您的 SSL 证书。我假设您必须添加中间证书,否则您的一些访问者会收到警告,指出该站点未由受信任的实例签名。

编辑:您可以自行检查您的 SSL 服务器是否一切正常,或者证书链是否不完整。

编辑2:

您的证书提供者对中间证书有很好的描述。这里是下载它的地方请参阅下面如何根据已安装的证书文件安装它。

# Apache configuration for specific virtual host ...
# start SSL/TLS
SSLEngine on
# set signed certificate file
SSLCertificateFile /etc/apache2/ssl/domain_certificate.crt
# set private key file
SSLCertificateKeyFile /etc/apache2/ssl/domain_certifikate.key
# set intermediate certificate / to complete the chain to the root certificate
SSLCertificateChainFile /etc/apache2/ssl/chain_certificate.crt
于 2012-04-28T17:31:44.777 回答
1

我会审查这些规则的放置位置。我怀疑您可能将它们放在虚拟主机部分或您的 SSL vHost 不匹配的其他地方。

于 2012-04-28T17:17:55.783 回答