<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: 修改.htaccess实现301重定向</title> <atom:link href="http://hugege.com/2008/07/01/htaccess/feed/" rel="self" type="application/rss+xml" /><link>http://hugege.com/2008/07/01/htaccess/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=htaccess</link> <description>网上吹水记录  hugege.com</description> <lastBuildDate>Sun, 13 May 2012 08:12:12 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: 老k博客</title><link>http://hugege.com/2008/07/01/htaccess/comment-page-1/#comment-14942</link> <dc:creator>老k博客</dc:creator> <pubDate>Sun, 13 May 2012 08:12:12 +0000</pubDate> <guid isPermaLink="false">http://hugege.com/2008/07/01/htaccess/#comment-14942</guid> <description>还要考虑端口不是80的情况，以将不带www的域名重定向带www的情况，官方的例子是这样的：
# For sites running on a port other than 80
RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)         http://www.example.com:%{SERVER_PORT}/$1 [L,R]# And for a site running on port 80
RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://www.example.com/$1 [L,R]</description> <content:encoded><![CDATA[<p>还要考虑端口不是80的情况，以将不带www的域名重定向带www的情况，官方的例子是这样的：<br /> # For sites running on a port other than 80<br /> RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]<br /> RewriteCond %{HTTP_HOST}   !^$<br /> RewriteCond %{SERVER_PORT} !^80$<br /> RewriteRule ^/(.*) <a href="http://www.example.com:%" rel="nofollow">http://www.example.com:%</a>{SERVER_PORT}/$1 [L,R]</p><p># And for a site running on port 80<br /> RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]<br /> RewriteCond %{HTTP_HOST}   !^$<br /> RewriteRule ^/(.*) <a href="http://www.example.com/$1" rel="nofollow">http://www.example.com/$1</a> [L,R]</p> ]]></content:encoded> </item> <item><title>By: kid</title><link>http://hugege.com/2008/07/01/htaccess/comment-page-1/#comment-14910</link> <dc:creator>kid</dc:creator> <pubDate>Fri, 13 Apr 2012 02:24:14 +0000</pubDate> <guid isPermaLink="false">http://hugege.com/2008/07/01/htaccess/#comment-14910</guid> <description>求解，那个“！”什么意思 是非么 说不通啊 求解啊 大神们</description> <content:encoded><![CDATA[<p>求解，那个“！”什么意思 是非么 说不通啊 求解啊 大神们</p> ]]></content:encoded> </item> <item><title>By: Jackie luo</title><link>http://hugege.com/2008/07/01/htaccess/comment-page-1/#comment-14908</link> <dc:creator>Jackie luo</dc:creator> <pubDate>Tue, 10 Apr 2012 16:33:52 +0000</pubDate> <guid isPermaLink="false">http://hugege.com/2008/07/01/htaccess/#comment-14908</guid> <description>打开.htaccess文件，加入以下规则。(下面的规则是针对主域名的，子域名要修改)RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]如果是文章页面的话应该怎么写啊
比如说abc.com/blog/123.html
改写成www.abc.com/blog/123/html   改这个文件能实现吗？谢谢！</description> <content:encoded><![CDATA[<p>打开.htaccess文件，加入以下规则。(下面的规则是针对主域名的，子域名要修改)</p><p>RewriteEngine On<br /> RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]<br /> RewriteRule ^(.*)$ <a href="http://www.domain.com/$1" rel="nofollow">http://www.domain.com/$1</a> [L,R=301]</p><p>如果是文章页面的话应该怎么写啊<br /> 比如说abc.com/blog/123.html<br /> 改写成www.abc.com/blog/123/html   改这个文件能实现吗？谢谢！</p> ]]></content:encoded> </item> <item><title>By: itvip</title><link>http://hugege.com/2008/07/01/htaccess/comment-page-1/#comment-14906</link> <dc:creator>itvip</dc:creator> <pubDate>Sat, 07 Apr 2012 16:23:33 +0000</pubDate> <guid isPermaLink="false">http://hugege.com/2008/07/01/htaccess/#comment-14906</guid> <description>我也把itvip.net重定向到www.itvip.net了，就是带“www”的网址百度收录一下剩一个了，原来还有二十来页呢！
还有我查的网上介绍的，都是Liunx的虚拟主机，代码却是：
Options +FollowSymLinks
RewriteEngine on 　　
RewriteCond % ^yourdomain.com 　　
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]
这是为什么？</description> <content:encoded><![CDATA[<p>我也把itvip.net重定向到www.itvip.net了，就是带“www”的网址百度收录一下剩一个了，原来还有二十来页呢！<br /> 还有我查的网上介绍的，都是Liunx的虚拟主机，代码却是：<br /> Options +FollowSymLinks<br /> RewriteEngine on 　　<br /> RewriteCond % ^yourdomain.com 　　<br /> RewriteRule ^(.*)$ <a href="http://www.yourdomain.com/$1" rel="nofollow">http://www.yourdomain.com/$1</a> [R=permanent,L]<br /> 这是为什么？</p> ]]></content:encoded> </item> <item><title>By: 美梦连连博客</title><link>http://hugege.com/2008/07/01/htaccess/comment-page-1/#comment-14887</link> <dc:creator>美梦连连博客</dc:creator> <pubDate>Fri, 09 Mar 2012 04:59:30 +0000</pubDate> <guid isPermaLink="false">http://hugege.com/2008/07/01/htaccess/#comment-14887</guid> <description># BEGIN WordPressRewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]# END WordPress
我的htsccess文件里已经有这些了，怎么办啊？
看网上说要加
RewriteEngine on
RewriteCond %{HTTP_HOST} ^oushistyle.com [NC]
RewriteRule ^(.*)$ http://www.oushistyle.com/$1 [L,R=301]
这个，但是到底是加到里面哪里啊？还是把原来的删掉再加啊？</description> <content:encoded><![CDATA[<p># BEGIN WordPress</p><p>RewriteEngine On<br /> RewriteBase /<br /> RewriteRule ^index\.php$ &#8211; [L]<br /> RewriteCond %{REQUEST_FILENAME} !-f<br /> RewriteCond %{REQUEST_FILENAME} !-d<br /> RewriteRule . /index.php [L]</p><p># END WordPress<br /> 我的htsccess文件里已经有这些了，怎么办啊？<br /> 看网上说要加<br /> RewriteEngine on<br /> RewriteCond %{HTTP_HOST} ^oushistyle.com [NC]<br /> RewriteRule ^(.*)$ <a href="http://www.oushistyle.com/$1" rel="nofollow">http://www.oushistyle.com/$1</a> [L,R=301]<br /> 这个，但是到底是加到里面哪里啊？还是把原来的删掉再加啊？</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Dynamic page generated in 0.157 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-15 22:35:13 -->
<!-- Compression = gzip -->
