mod rewrite - 处理没有php扩展名的url请求

时间:2017-05-14 19:03:37

标签: apache mod-rewrite httpd.conf

我希望没有.php结尾的服务器请求可以像处理.php一样处理。例如,用户请求http://example.com/exampleSite。我如何使用重写规则来处理它,就像http://example.com/exampleSite.php所要求的那样?我不想使用.htaccess(因为建议将重写规则放入apache vhost config中的目录块中。我只希望这会影响我在根目录中的php文件。

遗憾的是,以下配置不起作用。

{"fact checking": [ {"fact": "Clinton Foundation has no ships, didn’t smuggle refugees", "status":"false","source":"http://www.politifact.com/punditfact/statements/2017/may/12/blog-posting/fake-news-clinton-foundation-has-no-ships-didnt-sm/", "actual":"One way to tell if the story is made up, beyond its absurdity, is a link allegedly to a CNN story that is actually to a Forrest Gump meme that reads, "Are you stupid or something?""}, {"fact":"AG Jeff Sessions claims district attorneys charge immigrants for lesser crimes", "source":"http://www.politifact.com/truth-o-meter/statements/2017/may/10/jeff-sessions/sessions-claims-district-attorneys-charge-immigran/", "status":"half true", "actual":"Sessions spoke about "criminal aliens," a term generally applied to non-U.S. citizens – living in the United States legally or illegally – who are convicted of crimes."}, {"fact":"Is Sean Spicer Wearing Mismatched Shoes?", "source":"http://www.snopes.com/sean-spicer-shoes/", "status":"true", "actual":"A photograph showing the White House press secretary wearing two different types of footwear is real, but the oddity appears to serve a medical purpose rather than an avant-garde fashion choice."} ]}

0 个答案:

没有答案