QQ登录

只需一步,快速开始

 找回密码
 加入一朵

QQ登录

只需一步,快速开始

查看: 1255|回复: 0
打印 上一主题 下一主题

Apache 301转向的写法

[复制链接]
  • TA的每日心情
    开心
    2022-4-25 19:25
  • 签到天数: 562 天

    [LV.9]以坛为家II

    跳转到指定楼层
    1
    丨一朵丶小扇 发表于 2013-12-18 21:02:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    Apache中301转向有很多办法,下面列举其中几例:

    301 Redirects using Redirect(用Redirect命令实现)
    1. Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.kuqin.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
    2. Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.kuqin.com/htaccess/sending-post-form-data-with-php-curl.html
    3. Redirect 301 /htaccess.txt /wp-content/uploads/p/htaccess.txt
    4. Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.kuqin.com/tools/php-and-ajax-shell-console.html
    5. Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.kuqin.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
    复制代码
    301 Redirects using RedirectMatch(用RedirectMatch实现)
    1. RedirectMatch 301 ^/(.*)\.htm$ http://www.kuqin.com/$1.html
    2. RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.kuqin.com/$2$3
    3. RedirectMatch 301 ^/category/(.*)$ http://www.kuqin.com/$1
    4. RedirectMatch 301 ^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.kuqin.com/htaccess/htaccess.html
    5. RedirectMatch 301 ^/(.*)\.html/1/(.*) http://www.kuqin.com/$1.html$2
    6. RedirectMatch 301 ^/manual/(.*)$ http://www.php.net/manual/$1
    7. RedirectMatch 301 ^/dreamweaver/(.*)$ http://www.kuqin.com/tools/$1
    8. RedirectMatch 301 ^/z/(.*)$ http://static.kuqin.com/$1
    复制代码
    当然,还有通过htaccess文件来实现,比如
    1. RewriteRule ^(x*)$ http://www.duduhi.com/$1 [L,R=301]
    复制代码
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏 转播转播
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 加入一朵

    本版积分规则

    GMT+8, 2024-5-17 23:33

    © 2001-2011 Powered by Discuz! X3.2. Theme By Yeei!

    快速回复 返回顶部 返回列表