我正在尝试重新写入一个名为 /checkout 的特定子文件夹,这有一个为 https 附加的 SSL 证书
所以我在我网站的根文件夹中有这个 -
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
# in http: force secure.html to https
RewriteCond %{server_port} !=443
RewriteCond $1 ^([^/]+)$ [NC]
# this kinda works below but is resolving to index2.php and is showing in the url so not really working yet
RewriteRule checkout/([^/]+)\.html$ https://mysite.com/checkout/index2.php [L]
除了显示类似
https://mysite.com/checkout/index.html
表明
https://mysite.com/checkout/index2.php
(index2.php 是一个测试网址顺便说一句)
我还尝试将子文件夹中的 .htaccess 修改为类似
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{server_port} !=443
RewriteCond $1 ^([^/]+)$ [NC]
RewriteRule ^([^/\.]+)/?$ https://mysite.com/checkout/index2.php [L]
我只想处理
https://mysite.com/checkout/index.html
或者https://mysite.com/checkout/about-us.html
就像我在根中一样
https://mysite.com/index.html
=> https://mysite.com/index.php
(然后获取变量等)
IE
RewriteRule ^/?(catalogue-page)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+) index2.php?friendly_url=$1&catalogue_id=$2&view=catalogue&categoryid=$3&subcategoryid=$4&subjectid=$5&item=$6
我认为https更复杂。非常感谢任何指针/帮助等