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 请问如何在openpcdet上对KITTI数据集的测试集进行结果评估?
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错