htaccess n’autorise que les nombres après un certain point avec https

J’ai joint mon fichier htaccess actuel ci-dessous, il rend actuellement toutes mes URL www avec une barre oblique à la fin et si c’est sur et seulement sur / prepaid / ce sera https.

Je suis en train d’étendre cette fonctionnalité, où je peux également accepter les demandes de / prépayé / recharger / un numéro de téléphone à 10 chiffres et le faire aussi https

J’ai commencé par append cette ligne en bas, mais comment étendre la partie https pour autoriser également ce chemin?

RewriteRule ^prepaid/refill/([0-9]+)/?$ index.php?p=prepaid&phone=$1 [L] 

le code actuel

 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] 

Avoir votre plein .htaccess comme ceci:

 RewriteEngine On RewriteBase / # force www RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # force trailing slash RewriteCond %{REQUEST_FILENAME} !-f RewriteRule [^/]$ %{REQUEST_URI}/ [L,R=301] # force HTTPS for /prepaid/ OR /prepaid/refill/([0-9]+)/ RewriteCond %{HTTPS} off RewriteCond %{QUERY_STRING} !. RewriteRule ^prepaid(/refill/[0-9]+)?/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NC] # force HTTP for everything else RewriteCond %{HTTPS} on RewriteRule ^prepaid/(?!refill/[0-9]+).+$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NC] # internal rewrites RewriteRule ^prepaid/?$ index.php?p=prepaid [L,QSA,NC] RewriteRule ^prepaid/h2o-wireless/?$ index.php?p=prepaid&s=h2o [L,QSA,NC] RewriteRule ^prepaid/net10-wireless/?$ index.php?p=prepaid&s=net10 [L,QSA,NC] RewriteRule ^prepaid/page-plus-cellular/?$ index.php?p=prepaid&s=pageplus [L,QSA,NC] RewriteRule ^prepaid/red-pocket-mobile/?$ index.php?p=prepaid&s=redpocket [L,QSA,NC] RewriteRule ^prepaid/simple-mobile/?$ index.php?p=prepaid&s=simplemobile [L,QSA,NC] RewriteRule ^prepaid/refill/([0-9]+)/?$ index.php?p=prepaid&phone=$1 [L,QSA,NC] 

pour utiliser https, il faut écrire un peu ceci avec des expressions régulières, il faut être prudent et être: \ d + – ses seuls caractères numériques

 RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^prepaid/refill/(\d+)/?$ index.php?p=prepaid&phone=$1 [L]