dtcd27183 2013-06-06 07:30
浏览 81
已采纳

在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.

  • 写回答

2条回答 默认 最新

  • douyin4875 2013-06-06 07:42
    关注

    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/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?