全球主机交流论坛

标题: 301网址转发怎么写? 00000000000000000000000000000000000000000000000000 [打印本页]

作者: ZZPPP.COM    时间: 2014-1-2 21:03
标题: 301网址转发怎么写? 00000000000000000000000000000000000000000000000000
本帖最后由 ZZPPP.COM 于 2014-1-2 21:34 编辑
  1.   - regex_url: ^/b/1.html$
  2.     status_code: 301
  3.     location: http://www.gggg.com/baidu/xxoo.html
  4.   - regex_url: ^/b/52.html$
  5.     status_code: 301
  6.     location: http://www.avavav.com/baidu/avaaa.html
  7.   - regex_url: ^/b/13.html$
  8.     status_code: 301
  9.     location: http://www.555.com/baidu/index.html
复制代码


上面是BAE  上这么写的的  当初没备份。。..

NGINX 规则
rewrite ^/b/1.html(.*) http://www.ww.com/baidu/88.html$1 permanent;
rewrite ^/b/2.html(.*) http://www.dd.com/baidu/index.html$1 permanent;
rewrite ^/b/3.html(.*) http://www.aa.com/baidu/22.html$1 permanent;
rewrite ^/b/4.html(.*) http://www.xx.cc/baidu/baidu.html$1 permanent;


求APHche   

.htaccess 的规则怎么。 百度不给我绑定了 我要搬家了

作者: 贱人就是矫情    时间: 2014-1-2 21:03
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.ww.com$
RewriteRule ^/b/1.html$ http://www.ww.com/baidu/88.html [R=301,L]
RewriteRule ^/b/52.html$ http://www.avavav.com/baidu/avaaa.html [R=301,L]
RewriteRule ^/b/13.html$ http://www.555.com/baidu/index.html [R=301,L]

再试试。
作者: 贱人就是矫情    时间: 2014-1-2 21:23
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^/b/1.html$ [NC]
RewriteRule ^(.*)$ http://www.gggg.com/baidu/xxoo.html [R=301,L]
RewriteCond %{HTTP_HOST} ^/b/52.html$ [NC]
RewriteRule ^(.*)$ http://www.avavav.com/baidu/avaaa.html [R=301,L]
RewriteCond %{HTTP_HOST} ^/b/13.html$ [NC]
RewriteRule ^(.*)$ http://www.555.com/baidu/index.html [R=301,L]


试试。。
作者: ZZPPP.COM    时间: 2014-1-2 21:34
贱人就是矫情 发表于 2014-1-2 21:23
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^/b/1.html$ [NC]

不对。没有效果
作者: 贱人就是矫情    时间: 2014-1-2 21:48
或者这个

<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
Redirect permanent ^/b/1.html http://www.ww.com/baidu/88.html
Redirect permanent ^/b/52.html http://www.avavav.com/baidu/avaaa.html
Redirect permanent ^/b/13.html http://www.555.com/baidu/index.html
order deny,allow


作者: ZZPPP.COM    时间: 2014-1-2 23:20
RewriteCond %{HTTP_HOST} ^zzppp.com$ [NC]
RewriteRule ^b/059.html$ http://zzpppyy.com/baiduapp.html [R=301,L]
RewriteCond %{HTTP_HOST} ^zzppp.com$ [NC]
RewriteRule ^b/0051.html$ http://zzppptv.com/baidu/bdaidu.html [R=301,L]
RewriteCond %{HTTP_HOST} ^zzppp.com$ [NC]
RewriteRule ^b/5.html$ http://zzpppang.com/baidu/indsex.html [R=301,L]




欢迎光临 全球主机交流论坛 (https://hostloc.gdisk.cf/) Powered by Discuz! X3.4