continue
I am working on a project and I want to make the urls similar with the ones in use now.
For example, on stackoverflow, the urls do not end in .php (or any server side extension for that matter).
I want to be able to achieve that, I just do not know hot to go about it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
取决于你真正想做什么。 Stacko 可以通过基本控制器路由所有请求。例如,要在 Apache 中执行此操作,您可以:
如果您的控制器(和代码库)位于客户端代码的文件系统上的其他位置,您可以执行以下操作:
Depends on what you want to do really. Stacko may be routing all requests via a base controller. For example, to do that in Apache you would:
If your controller (and code base) live elsewhere on filesystem from client code, you can do:
mod_rewrite - http://httpd.apache.org/docs/current/mod/mod_rewrite .html
这是一个非常有用的重写向导,可帮助您入门
http://www.generateit .net/mod-rewrite/
另外,只需在 stackoverflow 上搜索 mod_rewrite 和 .htaccess - 您就会找到一些东西。
mod_rewrite - http://httpd.apache.org/docs/current/mod/mod_rewrite.html
This is a really useful rewrite wizard to get you started
http://www.generateit.net/mod-rewrite/
Also just have a search on stackoverflow for mod_rewrite and .htaccess - you'll find tones of stuff.