规则是:
RewriteRule ^r/([^/.]+)/?$ generateIssuePage.php?r=$1 [L]
当浏览器请求 myip.com/r/thing 时,它应该重定向到 myip.com/r/generateIssuesPage.php?r=thing。
如果我只输入 www.myip.com/r/generateIssuesPage.php?r=thing,它工作正常。但是如果我请求 www.myip.com/r/thing,我会得到 404。它有什么问题?
规则是:
RewriteRule ^r/([^/.]+)/?$ generateIssuePage.php?r=$1 [L]
当浏览器请求 myip.com/r/thing 时,它应该重定向到 myip.com/r/generateIssuesPage.php?r=thing。
如果我只输入 www.myip.com/r/generateIssuesPage.php?r=thing,它工作正常。但是如果我请求 www.myip.com/r/thing,我会得到 404。它有什么问题?
测试 htaccess 规则的好工具是http://htaccess.madewithlove.be/
使用该工具,它表明 htaccess 设置正确,以便http://www.myip.com/r/thing重定向到http://www.myip.com/r/generateIssuesPage.php?r=thing
您是否检查过 htaccess 是否完全适合您,但创建了一个简单的全局重定向?