URL.HTACCESS LINK 设置

URL .HTACCESS LINK SETTING

我有一个link https://example.com/article.php?article_link=10-scientists-who-made-the-dropsy-vaccine

我希望这个 link 有一个 url 喜欢 https://example.com/article/10-scientists-who-made-the-dropsy-vaccine

link 的最后一部分,即制造水肿疫苗的 10 位科学家是动态的,可以是任何东西

我该怎么做???

您可以使用 htaccess 执行此操作。打开您的 .htaccess 文件并输入以下规则:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^article/(.+)$ /article.php?article_link= [L,NC]