1

https://私のサイトのこれらのプレフィックス URL だけでプロトコルを作成したいと考えています。

dream-portal.net/index.php?page=postratingspro

dream-portal.net/index.php?page=paypaltest

したがって、この後の URL にもhttps://プロトコルが含まれている必要があります。例えば:

dream-portal.net/index.php?page=postratingspro;sa=blahblah;testing

これどうやってするの?次のことを試しましたが、サイトの他のすべての URL が http:// になるわけではありません。

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} = off
RewriteRule index.php?page=^(postratingspro|paypaltest)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]

# don't do anything for images/css/js (leave protocol as is)
RewriteRule \.(gif|jpe?g|png|css|js)$ - [NC,L]

# force http for all other URLs
RewriteCond %{HTTPS} = on
RewriteCond %{REQUEST_URI} !page=^/(postratingspro|paypaltest)\$
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]

どうすればこれを達成できますか?これに対する私のコードの何が問題なのですか?

4

1 に答える 1

1

コードを次のように置き換えます。

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?page=(paypaltest|postratingspro)[&;,\s] [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} !(^|&)page=(paypaltest|postratingspro)([,;&]|$) [NC]
RewriteRule ^(index\.php)?$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NC]
于 2013-07-13T17:37:21.907 に答える