垃圾邮件和旧网址修改 [英] Spam and Old URLs Modification

查看:95
本文介绍了垃圾邮件和旧网址修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是与创建伪造的URL全自动的。这是解决了<一href="http://stackoverflow.com/users/548225/anubhava">http://stackoverflow.com/users/548225/anubhava

. 因错误或垃圾邮件过多的网址已经建立像下面,但现在我想他们重定向到各自的岗位页的URL。

我会preFER的.htaccess。请帮忙

  abc.com/wp-admin/post.php?post=4051&action=edit
**重定向到**
abc.com/?p=4051
 

  abc.com/page/56/?option=com_content&view=article&id=94&Itemid=2
**重定向到**
abc.com/page/56/
 

  abc.com/category5/post-about-fashion/function.include
**重定向到**
abc.com/category5/post-about-fashion/
 

我用一句话preSS。我的永久链接为/%类别%/%postname%/。我的htaccess code是低于...

 &LT; IfModule mod_rewrite.c&GT;
RewriteEngine叙述上

#code。通过anubhava
的RewriteCond%{QUERY_STRING} ^ + $
重写规则^(页/ [0-9] + /)。* / $ 1〜 [L,NC,R = 301]
#code。通过anubhava

的RewriteBase /
重写规则^指数\ .PHP $  -  [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则。的index.php [L]
的RewriteCond%{HTTP_HOST} ^ WWW \ .deemasfashion \ .COM $
重写规则^ deemasfashion \ .COM /?(.*)$ http://deemasfashion.com/$1 [R = 301,L]
的RewriteCond%{THE_REQUEST} ^ [AZ] {3,9} \ /指数\ html的\ HTTP /
重写规则^指数\ html的$ http://deemasfashion.com/ [R = 301,L]
重写规则^指数\的.htm $ http://deemasfashion.com/ [R = 301,L]
&LT; / IfModule&GT;
 

解决方案

我相信你需要2个额外的规则:

 的RewriteCond%{QUERY_STRING} ^ + $
重写规则^(页/ [0-9] + /?)。* / $ 1〜 [L,NC,R = 301]

重写规则^(类[0-9] + / [^ /] + /?)+ $ / $ 1〜 [L,NC,R = 301]

的RewriteCond%{QUERY_STRING}(?:^ |&安培;)后=([^&功放;] +)[NC]
重写规则^可湿性粉剂管理员/后\的.php $ / P =%1 [L,NC,R = 301]
 

请确保这些都是前3名的规则略低于 RewriteEngine叙述在

This is with the reference of Fake URLs created automaticly. which was solved by http://stackoverflow.com/users/548225/anubhava

. By mistake or spam too many URLs have been created like below but now i want to redirect them to their respective post page URL.

I would prefer .htaccess. Please help

abc.com/wp-admin/post.php?post=4051&action=edit 
**Redirect to** 
abc.com/?p=4051

and

abc.com/page/56/?option=com_content&view=article&id=94&Itemid=2
**Redirect to** 
abc.com/page/56/

and

abc.com/category5/post-about-fashion/function.include
**Redirect to** 
abc.com/category5/post-about-fashion/

i am using wordpress. my permalink is /%category%/%postname%/. my htaccess code is below...

<IfModule mod_rewrite.c>
RewriteEngine On

# code by anubhava
RewriteCond %{QUERY_STRING} ^.+$
RewriteRule ^(page/[0-9]+/).*$ /$1? [L,NC,R=301]
# code by anubhava

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} ^www\.deemasfashion\.com$
RewriteRule ^deemasfashion\.com/?(.*)$ http://deemasfashion.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://deemasfashion.com/ [R=301,L]
RewriteRule ^index\.htm$ http://deemasfashion.com/ [R=301,L]
</IfModule>

解决方案

I believe you need 2 additional rules:

RewriteCond %{QUERY_STRING} ^.+$
RewriteRule ^(page/[0-9]+/?).*$ /$1? [L,NC,R=301]

RewriteRule ^(category[0-9]+/[^/]+/?).+$ /$1? [L,NC,R=301]

RewriteCond %{QUERY_STRING} (?:^|&)post=([^&]+) [NC]
RewriteRule ^wp-admin/post\.php$ /?p=%1 [L,NC,R=301]

Make sure these are top 3 rules just below RewriteEngine On

这篇关于垃圾邮件和旧网址修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆