简体   繁体   English

简单的Mod_rewrite

[英]Simple Mod_rewrite

For some reason, all of the documentation for mod_rewrites I could find across the web were dealing with large queries, etc. I would just like to have a user enter in: 出于某种原因,我可以在网上找到的mod_rewrites的所有文档都处理大型查询等。我只想让用户输入:

http://domain.com/page/faq  

where they would be accessing just /faq.php 他们将只访问/faq.php

Sorry for my inexperience, but I hope you'll forgive me! 对不起我的经验不足,但我希望你能原谅我! Thanks, Kevin 谢谢,凯文

将此规则放在文档根目录中的.htaccess中,根据需要添加标记:

RewriteRule ^page/(.*) $1.php

If you want only faq 如果你只想要常见问题

RewriteRule ^page/faq.php faq.php

Otherwise Ignacio has the better solution. 否则Ignacio有更好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM