How to redirect a url quickly and search engine friendly using .htccess

Share the love!
How to redirect a url with .htaccess

Hey friends Welcome to my blog here i go with my first post about How to redirect a url quickly and search engine friendly using .htccess In other words we say it 301 redirect.

So below is the code which u need to enter in your .htaccess file to redirect your page to your new domain page.

Redirecting a single page

Redirect 301 /youroldpage.html http://www.yoursite.com/yournewpage.html
Redirect 301 /youroldpage.html http://www.yoursite.com/folder/

So that is how we can redirect our old website link to new one like - www.myoldsite.com/folder/page.html will redirected to www.mynewsite.com/folder/page.html

What if you are moving a site to new domain? Use the below code in your .htaccess file to rediret your whole site to a new domain.

Redirecting the whole site

Redirect 301 / http://newsite.com/

Please Note: Dont forget that .htccess files works only on Apache servers!

Comment with-

Disqus Blogger Google Facebook

0 comments:

Post a Comment

Comments :