主机合租每年最低50元/博客新手特惠套餐: 每年98元拥有你的独立博客
January 31st, 2008 by paran

使用Mod_Rewrite功能重定向你的单篇页面

你会需要到重定向功能,我是指当你的主机支持Mod_Rewrite功能。,如果你不知道什么是Mod_Rewrite功能,那也可以说是支持.htaccess这个文件,如果那些喜欢抬扛的朋友说,哦,我同样不知道什么是.htaccess文件,那好,我之前搞了一个.htacess的系列教程,会让你知道的。

下面我们需要做的是如何在你的单篇页面进行重定向,你什么都不需要知道,只需要把下面的代码写进.htaccess文件:

Options +FollowSymlinks

RewriteEngine on

rewritecond %{http_host} ^example.com [nc]

rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]rewritecond %{SERVER_PORT} !^443$

rewriterule ^filename\.php(.*)$ https://www.example.com/filename.php$1 [r=301]

慢着,你还是需要知道一点的,www.example.com换成你的网站URL,Understand?

你可能还会感兴趣

你可能还会感兴趣的文章...

你还能做些什么?

关于作者

    paran
  • 作者名称: paran
  • 作者网址: http://parandroid.com
  • 一句话简介:I Am kEy tO ThE lOcK yOUr HOusE.

No Comments

(Required)
(Required, will not be published)