【发布时间】:2017-09-29 14:19:41
【问题描述】:
目前,我的网站有这种 url 格式:
https://example.com/blog/news.php?read=article-title-here
我想将此网址更改为: https://example.com/news/article-title-here
请问您知道怎么做吗?我尝试了这种方法,但在浏览器栏中没有看到任何变化(即使在清空缓存之后):
RewriteCond %{QUERY_STRING} ^read=(.*)$
RewriteRule ^news/?$ %1.php? [R=301,L]
另外,htaccess 文件应该写在哪里? 在https://example.com/ 或者 https://example.com/blog/
提前谢谢你!
本
【问题讨论】:
标签: .htaccess