douba5540 2012-04-28 17:13
浏览 31
已采纳

Mod重写不适用于SSL

Here is my rewrite code:

## 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>

But it doesn't work on SSL pages, for example:

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

and

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

Can someone help me make it work?

  • 写回答

2条回答 默认 最新

  • doujiao1538 2012-04-28 17:31
    关注

    Edit:

    http://www.genyx.co.uk/ -> shows some content

    https://www.genyx.co.uk/ -> shows the default Apache site "It works!"

    So the SSL server has a different DocumentRoot. If you change this it should work as expected.

    By the way, please check your SSL certificates. I would assume that you have to add intermediate certificates or some of your visitors will get warnings that the site is not signed by a trusted instance.

    Edit: You can check by yourself if everything is fine with your SSL server or if the certificate chain is incomplete.

    Edit 2:

    Your certificate provider has a nice description about intermediate certificates. And here is the place to download it. See below how you can install this in relation to the already installed certificate file.

    # 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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大