私はmod-rewriteを使用して、実際にURLを作成しています
www.example.com/public/questions.php?question_id= <int>
に行く
www.example.com/questions/ <int>
以前のアドレスを REQUEST_URI として使用することを禁止し、新しい短縮 URL のみを許可するにはどうすればよいですか?
ルールをつけたら
RewriteRule ^public public/page404_ready.php
これにより、現在変更されているすべての URL も役に立たなくなります。
(そして、これをすべて達成した場合、ページ内のすべての自分の (AJAX) リンクを新しい URL に変更する必要がありますか?)
これは現時点での私のファイルです
RewriteRule ^questions/topics/(.+)/?$ public/questions.php?topics=$1 [NC,L]
RewriteRule ^questions/ask/?$ public/ask_question.php [NC,L]
RewriteRule ^questions/edit/([0-9]+)/?$ public/edit_question.php?question_id=$1 [NC,L]
RewriteRule ^questions/posts/edit/([0-9]+)/?$ public/edit_post.php?post_id=$1 [NC,L]
RewriteRule ^users/edit/([0-9]+)/?$ public/edit_profile.php?user_id=$1 [NC,L]
RewriteRule ^(admin)/?$ public/$1/index.php [NC,L]
RewriteRule ^(admin)/(\w+)/?$ public/$1/$2.php [NC,L]
RewriteRule ^(admin)/(\w+)/(\d+)/?$ public/$1/$2.php?topic_id=$3 [NC,L]
RewriteRule ^([\w\-]+)/?$ public/$1.php [NC,L]
#RewriteRule ^public public/page404_ready.php [L]