すべてのフォルダーのindex.phpにスクリプトがあります
次のようなきれいな url/seo フレンドリーな url を作成する必要があります: site.com/folder1/something.html
今、私はこのような醜いURLを持っています: site.com/folder1/index.php?category=something
この部分index.php?category=something
は常にすべてのサブフォルダーで同じです。something.html
もう一度:index.php?category=1$
それを見つけて置き換え1$.html
ます。他には何も触れないでください。URLのこの部分だけです
だから私が訪問するとき:
site.com/another-subfolder/and-one-more-folder-here/index.php?category=something
アドレスバーでこれを見る必要があります:
site.com/another-subfolder/and-one-more-folder-here/something.html
私はあなたがそれを得る願っていますか?
folder1
ルートのhtaccessでこれを試しました
RewriteRule ^folder1/(.*).html$ folder1/index.php?category=$1 [L,R=301]
これは機能しますが、次のようにサイト全体のすべてのサブフォルダーでこれを機能させるにはどうすればよいですか:
site.com/folder145/index.php?category=something
site.com/subfolder/index.php?category=something
site.com/another-subfolder/and-one-more-folder-here/index.php?category=something
異なる名前のサブフォルダーが何千もあるため、サブフォルダーごとに手動で RewriteRule を作成しても機能しません
どんな助けでも大歓迎です