Your SlideShare is downloading. ×
How to create a 301 redirect
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

How to create a 301 redirect

1,176
views

Published on

How to create a 301 Redirect …

How to create a 301 Redirect

* Search Engine Friendly Method
* Change Page URLs with 301 redirects
* Permanently moved to a new location
* Can remove canonical issues(redirects to only www.domain.com) – webmaster can also be used to solve it
* Google understand these (www.abc.com and abc.com) as a different URL.
* Google recommends using a 301 redirect to change the URL of a page as it is shown in search engine results

www.gsesoftsolutions.com
A Tech Blog
Twitter: @GSESoftSolution
My Facebook Page @gsesoftsolutions

Published in: Internet, Technology, Design

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,176
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. How to create a 301 Redirect www.gsesoftsolutions.com A Tech Blog Twitter: @GSESoftSolution My Facebook Page @gsesoftsolutions
  • 2. 301 Redirect • Search Engine Friendly Method • Change Page URLs with 301 redirects • Permanently moved to a new location • Can remove canonical issues(redirects to only www.domain.com) – webmaster can also be used to solve it • Google understand these (www.abc.com and abc.com) as a different URL. • Google recommends using a 301 redirect to change the URL of a page as it is shown in search engine results
  • 3. Client Request • GET /index.php HTTP/1.1 Host: www.example.org • HTTP/1.1 301 Moved Permanently Location: http://www.example.org/index.asp Server Response
  • 4. Redirect to www using htaccess redirect • RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
  • 5. Redirect Old Domain to New Domain using 301 Redirect • RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
  • 6. Ruby on Rails Redirect • def old_action headers["Status"] = "301 Moved Permanently" redirect_to "http://www.new-domain.com/" end
  • 7. JSP (Java Server Pages) Redirect • <% response.setStatus(301); response.setHeader( "Location", "http://www.new-domain.com/" ); response.setHeader( "Connection", "close" ); %>
  • 8. CGI PERL Redirect • $q = new CGI; print $q->redirect("http://www.new- domain.com/");
  • 9. ASP(Active Server Pages) Redirect • <%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.new-domain.com/" %>
  • 10. PHP(Hypertext Preprocessor) Redirect • <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new- domain.com" ); ?>
  • 11. ColdFusion Redirect • <.cfheader statuscode="301" statustext="Moved permanently"> <.cfheader name="Location" value="http://www.new-domain.com">
  • 12. IIS Redirect • Start > Program > Administrative Tool > Go to Internet Service Manager • Right click on the file or folder which you need to redirect • Select a title named ‘redirection to a url’ • Enter the name of the page • Check the both the checkbox ‘A permanent redirection for this resource’ and ’exact url entered above’ and click on apply
  • 13. Check this Dialog Box
  • 14. ASP.NET Redirect • <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www .new-domain.com"); } </script>
  • 15. Thanks for Watching  www.gsesoftsolutions.com A Tech Blog Twitter: @GSESoftSolution My Facebook Page @gsesoftsolutions