我有我的網站運行在SSL上,但我添加了一個遊戲部分,使用閃存中的第三方遊戲。當我啓用SSL時,它停止工作。我很奇怪,如果我只能禁用該網址中包含「/ game /」的特定頁面上的SSL,以便遊戲正常運行。如何禁用SSL,如果一個頁面url包含一個特定的字
我試圖從insternet這個代碼在我的.htaccess文件,但不工作:
RewriteCond %{HTTPS} off
RewriteRule ^game^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
編輯:
我試着回答提示:
RewriteEngine On
RewriteCond %{HTTPS} On [NC]
RewriteRule ^game http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NC]
它的工作原理,但是當我去包含單詞「遊戲」的頁面將其他頁面也變成「http」,其他頁面變成使用「http」而不是「https」
然後我嘗試這樣的:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} On [NC]
RewriteRule ^game http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NC]
這它開始給我的消息「頁面沒有正確重定向」當我去「遊戲」頁面的URL。
我只希望「遊戲」頁面使用「http」。
編輯兩個:完整的.htaccess文件
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Get rid of index.php
RewriteCond %{REQUEST_URI} /index\.php
RewriteRule (.*) index.php?rewrite=2 [L,QSA]
# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?rewrite=1 [L,QSA]
# Try to route missing files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} public\/ [OR]
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
RewriteRule . - [L]
# If the file doesn't exist, rewrite to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]
</IfModule>
# sends requests /index.php/path/to/module/ to "index.php"
# AcceptPathInfo On
# @todo This may not be effective in some cases
FileETag Size
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
需要幫助。如果發現任何重複,請告知我,但我找不到任何人。 謝謝。
如果您在.htaccess文章中有更多規則,請在此完成.htaccess。 – anubhava
我添加了完整的代碼。 – M3Dev