Advertisement
tommyosheawebdesign

Website Redirects

Sep 13th, 2021
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1.  
  2. There are various ways to do this and various redirects, I've listed them below:
  3.  
  4. 301 (Permanent) Redirect: Point an entire site to a different URL on a permanent basis. This is the most common type of redirect and is useful in most situations. In this example, we are redirecting to the "example.com" domain:
  5.  
  6. # This allows you to redirect your entire website to any other domain
  7. Redirect 301 / http://example.com/
  8. 302 (Temporary) Redirect: Point an entire site to a different temporary URL. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date:
  9.  
  10. # This allows you to redirect your entire website to any other domain
  11. Redirect 302 / http://example.com/
  12. Redirect index.html to a specific subfolder:
  13.  
  14. # This allows you to redirect index.html to a specific subfolder
  15. Redirect /index.html http://example.com/newdirectory/
  16. Redirect an old file to a new file path:
  17.  
  18. # Redirect old file path to new file path
  19. Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
  20. Redirect to a specific index page:
  21.  
  22. # Provide Specific Index Page (Set the default handler)
  23. DirectoryIndex index.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement