学做网站培训课程介绍

当前位置:

电影网站如何设置伪静态

本课程视频是VIP会员课程,学习请进入VIP学习区

电影网站页面伪静态的原理就是 index.php?act=about&cid=1 将这种形式的动态路径用 about-1.html 这种形式输出,根据不同的服务器环境,配置方法也不太一样,PHP+iis6的话就要配置httpd.ini文件,php+iis7就要配置web.config,PHP+apache就要配置.htaccess文件

.htaccess规则示例:


RewriteEngine on
RewriteRule ^/?(index|guestbook|online)\.html$ index\.php [L]
RewriteRule ^/?(eindex)\.html$ index\.php?act=$1 [L]
RewriteRule ^/?(index|guestbook|online)-([0-9]+).html$ index\.php\?p=$2 [L]
RewriteRule ^/?([a-z0-9]+)_([0-9]+).html$ index\.php\?act=$1&id=$2 [L]
RewriteRule ^/?([a-z0-9]+)-([0-9]+).html$ index\.php\?act=$1&cid=$2 [L]
RewriteRule ^/?([a-z0-9]+)-([0-9]+)-([0-9]+).html$ index\.php\?act=$1&cid=$2&p=$3 [L]

httpd.ini示例:


[ISAPI_Rewrite]
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]
RewriteRule ^/(index|guestbook|online)\.html$ /$1\.php
RewriteRule ^/(eindex).html$ /index\.php\?act=$1
RewriteRule ^/(index|guestbook|online)-([0-9]+).html$ /$1\.php\?p=$2
RewriteRule ^/([a-z0-9]+)_([0-9]+).html$ /index\.php\?act=$1&id=$2
RewriteRule ^/([a-z0-9]+)-([0-9]+).html$ /index\.php\?act=$1&cid=$2
RewriteRule ^/([a-z0-9]+)-([0-9]+)-([0-9]+).html$ /index\.php\?act=$1&cid=$2&p=$3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

相关教程

  • 这是我学习了电影网站课程之后,自己仿了一个电影网站,准备做一个电影流量站,来卖广告位。电影网站可以让浏览者在线观看各类电影,电视剧,动漫
  • 怎么自己做一个电影网站 图文教程 (1108441 次浏览)
    电影网站介绍:电影网站是一种特别容易获取巨大用户流量的网站类型,一个好点的电影网站,每天可以获取上万用户浏览,可以获得较好的收益。电
  • 我们在做网站时,如果自己网站上的图片被别人复制过去,就会增加自己网站服务器的负担,所以在做网站时,需要做一些防盗链设置。如果你的空间支持.hta
  • 我们知道,网站伪静态可以形成静态页面,对于百度收录有着最大的好处。(相关知识:Discuz论坛后台SEO优化设置详细步骤)对于DISCUZ论坛程序实
  • 静态网页不显示图片 (119350 次浏览)
    作者: 脉动Email: 511039684@qq.com详细内容:今天听了老师讲的课程第九节:什么是网站静态页面,然后自己就动手去照着做,文字什么的都可以显
  • 在建站课程中,我们讲到网页设计和网站制作的区别,它们其实是两个不同的职业。其中一个操作就是把网页设计师设计好的图片转变成程序员可以用的代码,