Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

让apache服务器支持.htaccess重写

为了在本地调试网站,安装了apache,php5,mysql ,调试时发现网站路径打不开,文件名重写没开,如何让apache服务器支持.htaccess的重写呢?只要简单修改一下apache的httpd.conf设置就可以让 APACHE支 持.htaccess了。打开httpd.conf文件(在那里? APACHE目录的CONF目录里面),用文本编辑器打开后,查找

Options FollowSymLinks

AllowOverride None

改为

Options FollowSymLinks

AllowOverride All

就可以了。

免费博客链接–珍珠链

Technorati : apache, htaccess, rewrite, 重写 Del.icio.us : apache, htaccess, rewrite, 重写 Zooomr : apache, htaccess, rewrite, 重写 Flickr : apache, htaccess, rewrite, 重写

. . . → Read More: 让apache服务器支持.htaccess重写

使用htaccess 301重定向功能规范化网址

随着cn域名的限制增多,越来越多的人使用com域名,如果将已有的权重转移到新的域名呢?我们推荐利用Apache的.htaccess,使用301重定向,规范网址,更换域名,前提是服务器空间必须支持Apache的Rewrite功能。 新建一个空文件:**.htaccess,输入重定向规则,然后将其上传到网站根目录,并重命名为.htaccess。 这里的.htaccess写法如下,仅共参考: 用301将不带WWW的域名重定向:即将supplypearl.com统一为www.supplypearl.com

rewriteEngine on rewriteCond %{http_host} ^supplypearl.com[NC] rewriteRule ^(.*)$ http://www.supplypearl.com/$1 [R=301,L]

用301将绑定的其他域名重定向到主域名,将csslog.com和www.csslog.com.cn统一为www.supplypearl.com

RewriteEngine on RewriteCond %{HTTP_HOST} ^csslog.com.cn$ [OR] RewriteCond %{HTTP_HOST} ^www.csslog.com.cn$ RewriteRule ^(.*)$ http://www.supplypearl.com/$1 [R=301,L]

此处也可以写成:

RewriteCond %{HTTP_HOST} ^(www.)?csslog.com.cn$ RewriteRule ^(.*)$ http://www.supplypearl.com/$1 [R=301,L]

当然,也可以再扩展一下,将index.html、index.php等也重定向一下:将www.supplypearl.com/index.php统一为www.supplypearl.com

RewriteEngine on RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.supplypearl.com/ [R=301,L]

弄好之后,用这个免费工具检查一下转向的效果吧:

http://www.internetofficer.com/seo-tool/redirect-check/

Technorati : 301, . . . → Read More: 使用htaccess 301重定向功能规范化网址