結果なしで多くのコードを試しました。私はwordpressを使用しており、検索結果のURLは次のとおりです。
http://mysite.com/search/the%20search%20query%20
私はそれを変更する必要があります
http://mysite.com/search/the-search-query/
htaccessで方法はありますか?
これは実際に私のhtaccessファイルです:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Options +FollowSymlinks -MultiViews
RewriteRule ^(.+)(\s|%20)(.+)$ /$1-$3 [R=301,QSA,L,NE]
# END WordPress
最後の書き換えルールは、成功せずに試したものです