How do i redirect my site using a

      37

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 http://www.yoursite.com/newpage.htmlRedirect 301 /oldpage2.html http://www.yoursite.com/folder/Redirect an entire siteThis way does it with liên kết intact. That is www.oldsite.com/some/crazy/liên kết.html will become www.newsite.com/some/crazy/links.html. 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 / http://newsite.com/
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.


Comments


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 “website.com/” & “trang web.com/index.html” lớn “website.com” for the index page to lớn maximize tìm kiếm engine points.


Reply
Gabe
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


Reply
Mitch
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


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

I simply use html redirect pages that look like this:

Forbidden Area


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

Hi how would you 301 redirect

http://www.example.com lớn example.com

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


Reply
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 http://jayjalaramext.com/tương tác.html which is old one khổng lồ the new one http://jayjalaramext.com/contact-us

Check it.


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

WWW / No-WWW


Reply
Daniel Winnard
Permalink to comment# February 3, 2012

Hi,

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 blog.website.com lớn http://www.website.com using htaccess if no folder or sub domain now exists. Is this even possible?


Reply
Narcís
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 myDomain.com http://www.myDomain.com

or the short version: Redirect 301 / http://myDomain.com/

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


Reply
Vinny
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 http://www.mysite.com

và the other is:

Redirect 301 /Margin-Accounts.9.htm http://www.mysite.com/margin-accounts.html

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

Options +FollowSymLinksRewriteEngine onRewriteRule http://www.mysite.com

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


Reply
Jon
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 http://rainbowsafety.co.uk/41-fire-refuge-safety-signs

The above redirect works fine, however when I type in http://astonsafetysigns.co.uk/gb/41-fire-refuge-safety-signsI am redirected to lớn http://rainbowsafety.co.uk/41-fire-refuge-safety-signsvà want to lớn be redirected lớn http://astonsafetysigns.teo.uk/41-fire-refuge-safety-signs

Is there a way in which this can be achieved?


Reply
Todd
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


Reply

Leave sầu a Reply Cancel reply

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


Chuyên mục: SEO