PHP ファイルに対応する URL を持つ Web サイトがあります。
www.mysite.com/cat.php?id=stuff
これらの PHP ファイルはもう存在しません。新しい URL への 301 リダイレクト (SEO の理由から) を行うにはどうすればよいですか?
www.mysite.com/stuff
私は試した
rewrite ^/cat\.php\?id=stuff http://www.mysite.com/stuff? permanent;
しかし、「入力ファイルが指定されていません」というメッセージが表示されてうまくいきません。
ご協力ありがとうございました!
編集:
私の設定の詳細(ウェブサイトはWordpressを利用しています):
index index.php;
root /var/www/mydirectory;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}