How to hide file path in URL?

自闭症网瘾萝莉.ら 提交于 2019-12-07 06:43:04

问题


What would be the best way to way to change my URL address to a custom one? Currently my website shows:

http://nkonecny.com/_pages/_portfolio/port.html

I want to change it to something like this:

http://nkonecny.com/portfolio

回答1:


You can use mod_rewrites.

Here is a good linux/apache tutorial




回答2:


.htaccess would be the best option.

http://httpd.apache.org/docs/1.3/howto/htaccess.html




回答3:


mod_rewrite will do rewrites of this sort, but your pages have to follow a fairly strict naming/pathing convention for it to work. If you've got arbitrary path->names, then this won't work and you'll probably have to resort to a series of Apache 'Alias' directives.




回答4:


You want to use URL rewriting. If you are using apache, you can get full information here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html



来源:https://stackoverflow.com/questions/6999720/how-to-hide-file-path-in-url

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!