Connect with us

Hi, what are you looking for?

Web Hosting

Code Snippet: 301 Redirects Using .Htaccess

HTACCESS 301 Redirects

A 301 redirect is a permanent way to let search engines and visitors know that an old page on your website has been replaced by a new one.

If you would like to create your own redirects using your website’s htaccess, open your .htaccess file (typically found in the root of your website) and add the following code:

Redirect 301 /myveryoldpage.html http://www.yoursite.com/myverynewpage.html
Redirect 301 /login/ http://www.yoursite.com/account/

If you would like to redirect your entire website to a new website and you are keeping the exact same page structure you can add the following code to your old website:

Redirect 301 / http://mynewwebsite.com

As an example, the code above will cause http://myoldwebsite.com/services/glossary.html to redirect to http://mynewwebsite.com/services/glossary.html so there is no need to worry about creating a separate redirection for each page.

One thing to note is that .htaccess redirections only work with Apache servers.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisement

More On The Net BLog

Business

As per our previous announcement, the Website Helper blog has now become thenet.blog. Here we have it, 36 approved UK business directories you can...

CSS

CSS media queries are an excellent way to deliver different styles to different devices. Here are CSS Media Queries for targeting your iPad in...

Web Hosting

GoDaddy has become a household brand, they are one of the biggest website hosting and domain name companies in the world. However, being the biggest does...

WordPress

Did you know that uninstalling WordPress plugins from the dashboard is simply not enough? Many website owners have most likely installed and tested several WordPress plugins but...

Business

Are you looking for alternatives to Peopleperhour.com to outsource your next project? For those that don’t know what Peopleperhour.com is, it’s an online freelance micro job...

SEO

Traffic is bad on the road. But it is a blessing on a website or blog- as long as your bandwidth can handle it....

WordPress

The problem faced by many WordPress websites using contact forms is spamming. It is frustrating and time-consuming to deal with. Spamming happens when malicious...

CSS

CSS media queries are an excellent way to deliver different styles to different devices. The rapid growth of mobile devices has made it a...

Advertisement