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.
我需要将所有查询重定向到文件 1.php 到文件 2.php。所以我需要如果有人会问 1.php 服务器会给他 2.php。1.php 和 2.php 在同一个文件夹中。
RewriteEngine On RewriteRule ^2.php 1.php
htaccess 中的这段代码不起作用。错误在哪里?
试试这个:
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?[the folder]/1.php$ RewriteRule ^(/)?$ [the folder]/2.php [L]