PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 11, 2022

[FIXED] Search engines are showing the old URL even after implementing a redirect

 March 11, 2022     cakephp, php, redirect, seo     No comments   

Issue

I just want to know what code I use in .htaccess file for 301 redirection.

My old URL is http://www.mercurysolutions.co/training/certified-ethical-hacker-v9-course and I want to redirect this to http://www.mercurysolutions.co/ec-council/certified-ethical-hacker-v9-course

I've tried this code in app/.htaccess and app/webroot/.htaccess both

Redirect 301 /training/certified-ethical-hacker-v9-course /ec-council/certified-ethical-hacker-v9-course

When I search on search engines related to my company site, it shows the old URL with 404 error. But If I click on that, It redirects to new URL.


Solution

RedirectMatch 301 ^/training/certified-ethical-hacker-v9-course /ec-council/certified-ethical-hacker-v9-course

This should redirect your pages.

Search engine is different things. Google has index your old link and shows your old link when searched on search engine. To remove your old link from Google Index from Google WebMaster Tool and should add 410 Gone header so that when Google bot crawls it will notice that the index page has gone.



Answered By - Krishna Pariyar
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing