Hello everybody, few days ago I have deleted a post but that post has back link from other site. When somebody come through that address to my site, they got 404 page! Well, then I added a simple line on my .htaccess file to redirect all visitor of that post to a new related post. Well lets see that how to redirect a old post link into a new link.
In my case, the line was as follow
Redirect 301 /?p=1120 /2011/02/add-font-in-menubar-of-microsoft-word/
Where /?p=1120 is a old page looks like http://shariarbd.com/?p=1120 and I have redirect it into the new address /2011/02/add-font-in-menubar-of-microsoft-word/which is actually http://shariarbd.com/2011/02/add-font-in-menubar-of-microsoft-word/
Since the new page is also on the same server, is used /2011/02/add-font-in-menubar-of-microsoft-word/ on the 2nd value.
Redirect is actually say to server that server need to redirect a url to another and the basic syntax is
Redirect 301 /old-page/ /new-page/
Where 301 says that the old page is moved permanently to the new page
/old-page/ is the page what will be redirect and /new-page/ is the page where the old-page will be redirect.
Well, I hope you understand the above. Now if you want to redirect page to a new site or that page is not in the same site, follow
Redirect 301 /old-page/ http://example.com/new-page/
Here, replace example.com with your site where you want to go your visitor.
Now you are ready to Redirect Single URL to new web page or new address
So... find your broken link and redirect to the link.
* htaccess is actually a file name and what we write there is accordingly as rewrite mode module. mod_rewrite is a module uses a rule-based rewriting engine for Apache Server that tell to the server to react accordingly as instruction of .htaccess file.