How to Exclude Some Pages Redirection After Migration via Htaccess?

seowarrior008

Senior Member
Joined
Feb 7, 2012
Messages
930
Reaction score
245
Hey guys, I recently migrated one old website to a new domain and did 301 redirection on the entire website via htaccess codes.

However, I noticed that some pages of my old website were spammed by others, but these spammy pages are also migrated and redirected to my new domain website. Thats obviously bad for SEO.

So, i would like to remove these spammy pages redirection, and keep them isolated with my new domain website.

Does anyone know how I can do this via htaccess? or any other ways to remove these spammy pages redirection?

thanks a lot in advance :)
 
Obviously there is a lot other methods to do this, but those 2 are pretty easy to implement.

You can delete them from index:
RewriteRule ^wrong-webpage$ - [G,L]

Or tell the robot to not index them:
RewriteRule ^wrong-webpage$ - [E=NOINDEX_HEADER:1]
Header Set X-Robots-Tag "noindex, nofollow" ENV=NOINDEX_HEADER
Header Set X-Robots-Tag "noindex, nofollow" ENV=REDIRECT_NOINDEX_HEADER
 
Obviously there is a lot other methods to do this, but those 2 are pretty easy to implement.

You can delete them from index:


Or tell the robot to not index them:
thanks for helpful reply bro,
so, i should add these codes in htaccess, not robot.txt, right?
This part ^wrong-webpage$ will cover all my 404 spammy pages (i deleted all of them), correct?
thanks again
 
Back
Top