easyphp .htaccess 规则
我需要在 Windows 7 上安装 easyphp 时重写规则。
我需要确保规则加载正确,并且不必创建大量规则。另外,当我将 .htaccess 复制到我的服务器(Linux)时,我想确保它正常工作。
我没有这方面的经验,这是我在互联网上发现的:
RewriteRule (.*) index.php?s=$1
现在,如果我有像“联系我们”这样的基本页面,那就可以了,但如果我有子页面,那就不行了。如何创建子文件夹?
谢谢
i need to rewrite rules in my installation of easyphp on windows 7.
i need to make sure the rules are loaded correctly and i don't have to create tons of rules. also, when i copy the .htaccess to my server (which is linux) i want to make sure its working properly.
i have no experience with this and here's what i found diging the internet:
RewriteRule (.*) index.php?s=$1
now, if i have basic page like 'contact-us' its ok but if i have sub pages it does not. how can i create sub folders?
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您需要做的:
这将允许您拥有如下页面:
/? 表示斜杠是可选的
[NC] 这使得测试用例不敏感 - 之间的差异在扩展的 TestString 和 CondPattern 中,“AZ”和“az”都被忽略。该标志仅对 TestString 和 CondPattern 之间的比较有效。它对文件系统和子请求检查没有影响。
[L] [L] 标志导致 mod_rewrite 停止处理规则集。在大多数情况下,这意味着如果规则匹配,则不会处理更多规则。
有关标志和规则的所有信息:http://httpd.apache.org/docs/current/mod/ mod_rewrite.html
Here's what you need to do:
This will allow you to have pages like:
/? Means the slash is optional
[NC] This makes the test case-insensitive - differences between 'A-Z' and 'a-z' are ignored, both in the expanded TestString and the CondPattern. This flag is effective only for comparisons between TestString and CondPattern. It has no effect on filesystem and subrequest checks.
[L] The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed.
All the information about flags and rules: http://httpd.apache.org/docs/current/mod/mod_rewrite.html