0

サイトには、次のような html ファイルを含むいくつかのディレクトリがありました。

site.com/folderone/index.html
site.com/foldertwo/index.html

次のようなリンクから入手できました。

site.com/folderone
site.com/foldertwo

これらのディレクトリはすべて /old-pages に移動しました。

site.com/old-pages/folderone/index.html
site.com/old-pages/foldertwo/index.html

ただし、古いリンクは利用できるはずなので、.htaccess ファイル:

RewriteEngine on
RewriteRule ^folde(.*)$ /old-pages/folde$1 [L]

正しいsite.com/folderone/site.com/folderone/index.htmlを書き直します

問題は、site.com /folderoneの場合、書き換えではなく、site.com/old-pages/folderone/ にリダイレクトすることです。

4

1 に答える 1