Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
抱歉,我已经搜索了一些相关的问题/答案,但不确定如何继续。
我希望默认 index.html 文件自动转到 index.html?id=1
这可能吗?如果是这样,有人可以帮助我使用适当的 .htaccess 命令吗?
谢谢。
RewriteEngine on RewriteBase / RewriteCond %{QUERY_STRING} !id= RewriteRule ^index.html$ index.html?id=1 [R=301,QSA,L]
如果查询字符串不包含 id 参数,用户将被重定向到查询字符串中带有 id 的版本。将保留查询字符串的任何其他元素。
我认为我已经习惯了关于项目中 PHP 声明的相当自由的政策 - 我一直只是使用:
<? // here is my php code ?>
我只是在 FastCGI 下使用 PHP-FPM 设置了一个 nginx 服务器,现在它需要我明确声明:
<?php // here is my php code ?&