鉴于此链接:localhost/app/forms/enroll.php。我希望它在我访问/注册时呈现。
例如:localhost/register 将显示 localhost/app/forms/enroll.php
所以基本上我有这个代码:
RewriteEngine On
RewriteBase /
RewriteRule register app/forms/enroll.php
在我的代码中,我调用了 localhost/enroll.php,我想将其重定向到 /app/enroll.php,但随后我想再次显示链接(localhost/register)。
所以我需要再次回调我上面所做的 RewriteRule。
添加此规则不起作用
RewriteRule enroll.php register [R]
还有这个
RewriteRule enroll.php app/forms/enroll.php [C]
RewriteRule app/forms/enroll.php register
注意:我需要解决此问题,而不必更改代码中的链接。:)