How do i redirect my site using a


This is the cleanest way khổng lồ redirect a URL. Quiông chồng, easy, và search-engine friendly. Remember HTAccess stuff is for Apabịt servers only.

Bạn đang xem: How do i redirect my site using a

Redirect a single pageRedirect 301 /oldpage.html 301 /oldpage2.html an entire siteThis way does it with liên kết intact. That isên kết.html will become This is extremely helpful when you are just “moving” a site to lớn a new tên miền. Place this on the OLD site:

Redirect 301 /
Our Learning Partner


Frontend Masters
Need front-over development training?Frontend Masters is the best place to lớn get it. They have courses on all the most important front-over technologies, from React lớn CSS, from Vue lớn D3, & beyond with Node.js và Full Stack.


Need front-over development training?

Frontkết thúc Masters is the best place to lớn get it. They have sầu courses on all the most important front-over technologies, from React to lớn CSS, from Vue to lớn D3, and beyond with Node.js and Full Stachồng.


Richard Razo
Permalink lớn comment# October 22, 2009

How would you code a 301 redirect for the following?:I want to lớn redirect “” & “trang” lớn “” for the index page to lớn maximize tìm kiếm engine points.

Permaliên kết lớn comment# November 10, 2009

Does this works the same when you use regular expressions? Maybe you should add another example.

Xem thêm: Dịch Anh Sang Tiếng Việt Hoặc Dịch Câu Từ Tiếng Viết, PhầN MềM DịCh TiếNg Anh & Từ đIểN

Permalinks khổng lồ comment# August 30, 2010

yes, I have sầu apabít VPS, (VPS)yes, I bởi have sầu other .htaccess files on it and they all workno – this redirect line doesn’t bởi vì a thing

Permalinks khổng lồ comment# April 22, 2011

I simply use html redirect pages that look like this:

Forbidden Area

Shaneka Landell
Permaliên kết lớn comment# October 28, 2011

Hi how would you 301 redirect lớn

I’m using Codeigniter framework, so i’m not sure if there’s a different process

Jay Jalaram Extrusions
Permalink khổng lồ comment# November 7, 2011

Thanks it works, I have used it in my website Jay Jalaram ExtrusionsBy redirectingương tác.html which is old one khổng lồ the new one

Check it.

Permaliên kết lớn comment# December 19, 2011
shaneka I think you are looking for the www to no-www snippet.


Daniel Winnard
Permalink to comment# February 3, 2012


Just found this trang web for snippets. Awesome.

I am having a problem which somebody toàn thân might be able to lớn help with.

My company has just redeveloped our trang web. It is going all wordpress. However the initial site was in standard html và css. and we had a blog on a sub domain running wordpress.

The problem now is we have deleted the sub domain name for the blog as we are totally switching away from it. Some of its pages are listed in google. How would we redirect from lớn using htaccess if no folder or sub domain now exists. Is this even possible?

Permalinks khổng lồ comment# September đôi mươi, 2013

Could this be applied khổng lồ redirect from non www to www ? Something like:Redirect 301

or the short version: Redirect 301 /

Could this work? is it necessary to lớn include http:// ?

Permaliên kết to comment# January 17, 2014

Someone please help me. I have sầu a trang web that was done in coldfusion and I am trying khổng lồ redirect to lớn an html page. I have sầu two problems, however: one problem is the following:

Redirect 301 /tax_glossary.cfm

và the other is:

Redirect 301 /Margin-Accounts.9.htm

I have sầu this at the beginning of the htaccess file:

Options +FollowSymLinksRewriteEngine onRewriteRule

I keep getting an internal VPS error.

Xem thêm: #3 Cách Làm Kim Chi

Any help would be greatly appreciated.

Thank you

Permaliên kết khổng lồ comment# June 25, 2014

I currently have sầu a redirect phối up as follows

Redirect 301 /gb/41-fire-refuge-safety-signs

The above redirect works fine, however when I type in am redirected to lớnà want to lớn be redirected lớn

Is there a way in which this can be achieved?

Permalink to lớn comment# December 18, 2018

Hello – My 301 redirects are not working. Can you help me with the correct code? Here is my htaccess code:

BEGIN WordPress

RewriteEngine OnRewriteBase /RewriteRule ^index.php$ – RewriteCond %REQUEST_FILENAME !-fRewriteCond %REQUEST_FILENAME !-dRewriteRule . /index.php // redacted

END WordPress


Leave sầu a Reply Cancel reply

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

Chuyên mục: SEO