我在下面附上了我当前的 htaccess 文件,它目前使我所有的网址 www 末尾带有斜杠,如果它打开并且仅在 /prepaid/ 上,它将是 https。
我正在尝试扩展此功能,我还可以接受来自 /prepaid/refill/ 10 位电话号码的请求,并将其设置为 https
我首先在底部添加了这一行,但是我将如何扩展 https 部分以允许从这条路径开始?
RewriteRule ^prepaid/refill/([0-9]+)/?$ index.php?p=prepaid&phone=$1 [L]
当前代码
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} !. [NC]
RewriteRule ^prepaid/?$ https://www.domain.com/prepaid/ [R=301,L]
RewriteCond %{HTTPS} on
RewriteRule ^prepaid/(.+) http://www.domain.com/prepaid/$1 [R=301,L,QSA]
RewriteRule ^prepaid/?$ index.php?p=prepaid [L]
RewriteRule ^prepaid/h2o-wireless/?$ index.php?p=prepaid&s=h2o [L]
RewriteRule ^prepaid/net10-wireless/?$ index.php?p=prepaid&s=net10 [L]
RewriteRule ^prepaid/page-plus-cellular/?$ index.php?p=prepaid&s=pageplus [L]
RewriteRule ^prepaid/red-pocket-mobile/?$ index.php?p=prepaid&s=redpocket [L]
RewriteRule ^prepaid/simple-mobile/?$ index.php?p=prepaid&s=simplemobile [L]