Helping you build a better website
(and other interesting web stuff)

CSSHTMLJavaScriptjQueryMSSQLMySQLPHPSilvaTechnologiesWordpress
Silva Web Designs - Blog

301 Redirects via .htaccess

The cleanest way to redirect a URL in a quick, easy, and search-engine friendly way is to do them through your .htaccess file which is usually found in your websites root folder (ie. httpdocs).

Note: htaccess stuff is for Apache servers only.

Redirect a single page


Redirect 301 /oldwebpage/ http://www.yourwebsite.com/newpage.html
Redirect 301 /oldwebpage2.html http://www.yourwebsite.com/folder/

Redirect an entire site


Redirect 301 / http://newwebsite.com/

Meta Refresh

An alternative way is to do a Meta Refresh, this is a line of code you would add between the elements. The following redirects to the specified URL in 3 seconds. Set to 0 for an immediate redirect.


<meta http-equiv="refresh" content="3;url=http://newwebsite.com/" />

301 Redirect Code Generator

If you need help generating the code for your redirects you can visit this website.

It will allow you to generate the code you need and supports web pages redirection for HTML, PHP, ASP, ASPX files and .htaccess redirect.

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well of many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

Join the discussion