在url中使用全名,而不是像“index.php?id = 0”

在url中使用全名,而不是像“index.php?id = 0”

问题描述:

Last year I created my own website from scratch. Although it is nothing big, I would like to improve it by replacing awkward, hard to remember, URLs.

So, I would very much like to move from "http://www.iubuntu.cz/index.php?id=0" to "http://www.iubuntu.cz/" and from "http://www.iubuntu.cz/index.php?id=1" to "http://www.iubuntu.cz/desktop".

Can someone please redirect me to some info about this? I was trying to find something through Google, but it seems I am unable to ask a proper question.

Thank you very much.

去年我从头创建了自己的网站。 虽然它没什么大的,但我想通过替换尴尬,难以记住的URL来改进它。 p>

所以,我非常想从“ http://www.iubuntu.cz/index.php?id=0 ”to“ http://www.iubuntu.cz/ “和” http://www.iubuntu.cz/index.php?id=1 ”to“ http://www.iubuntu.cz/desktop ”。 p>

有人可以请我转发一些关于我的信息吗? 这个? 我试图通过谷歌找到一些东西,但似乎我无法提出正确的问题。 p>

非常感谢。 p> div>

For makng your website url user friendly and SEO friendly you can do it by URL rewriting. That's mean your original Url will mapped to a SEO friendly custom url. e.g. "http://www.iubuntu.cz/index.php?id=0" to "http://www.iubuntu.cz/desktop".

To do this you need to know .htaccess. Here is the sample of url rewriting using htaccess.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteRule ^Users/home$ http://www.example.com/ [L,R=301]
RewriteRule ^index.php$ http://www.example.com/ [L,R=301] 
</IfModule>

To know more check this link, it is very useful. http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

You need to look into using URL rewriting with .htaccess.

Here's an intro article by Smashing Magazine.