您好我已经写了下面的内容并且有些不对劲但无法弄清楚是什么。
需要发生的是任何没有/最终的网址都需要/
任何非www都需要是www
问题1,它似乎没有添加试用斜线到结尾让我们说/谢谢你
问题2,当你去mydomain.com/thank-you/时,你会得到www.mydomain.com/thank-you.php /
提前致谢
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}/ [R=301,L]
RewriteRule ^thank-you/?$ thank-you.php [L]
RewriteRule ^thank-you.php$ http://%{HTTP_HOST}/thank-you/ [L]
RewriteRule ^/?$ index.php [L]
RewriteRule ^index.php$ http://%{HTTP_HOST}/ [L]