0

ディレクトリとそのrss/index.phpサブディレクトリ内の .php ファイルを .xml ファイルに書き換えたいのですが、このルールでサイト内の他のディレクトリに影響を与えたくありません。rss/all/index.phprss/main/index.phpsub directories

すなわち

root/rss/index.php to root/rss/index.xml

root/rss/all/index.php to root/rss/all/index.xml

私は mod の書き換えについてあまり知りません。この方法を試してみましたが、何もしません。

RewriteRule   ^/rss/.xml$     $1.php [L]
also tried like this
RewriteRule   ^(rss).xml$     $1.php [L]

これを行うための可能な方法を見て提案してください。

ありがとう。

4

1 に答える 1

0

試す:

RewriteRule ^/?Site/rss/(.*)\.xml$ /Site/rss/$1.php [L]

これにより/rss/something.xml、誰かがリクエストしたときに、にあるものは何でも提供されるようになり/rss/something.phpます。これらのルールは、ドキュメントルートのhtaccessファイルに含まれている必要があります。

于 2013-02-27T08:07:11.300 に答える