URL: http://localhost/url/of/the/keyword/whatever/
RewriteRule ^url/of/the/keyword/([a-z]+)/?$ ?keyword=$1 [L]
// php
echo $_GET['keyword'];
// outputs **whatever** (OK)
RewriteRule ^url/of/the/keyword/(.*)/?$ ?keyword=$1 [L]
// php
echo $_GET['keyword'];
// outputs **whatever/** (with a trailing slash, which is not expected)
2番目の条件の末尾にスラッシュがある理由を誰か説明できますか?
また、パーセンテージ サインインの URL 書き換えを許可するにはどうすればよいですか?
http://localhost/url/of/the/keyword/%40%23%24/
RewriteRule ^url/of/the/keyword/([0-9a-zA-Z-.%])/?$ ?keyword=$1 [L]
上記のルールは機能しません。Z、0-9、ドット、ハイフン、およびパーセント記号を許可するように誰でもこれを修正できますか?
ありがとう!