Avoid URL redirects

Updated on Mar 13, 2019

Method Type: User (Content)

Status: Must be applied by the user

Introduction:

When a user is trying to access content that has been moved permanently or temporarily he will be redirected using the status codes 301 and 302 respectively. The HTTP headers will look like this:

HTTP/1.1 301 Moved Permanently

      Location: http://example.com/new

      Content-Type: text/html

The location is the new URL to which the user is being redirected and the content-type shows what content he is trying to access.

How redirecting works:

Using URL redirects will delay page loading as the page cannot be rendered until the HTML document has been received from the web server. One of the most common redirects is the missing trailing slash one. If the directory where the content is situated ends with a slash but the clickable URL doesn't contain the slash the user will be redirected to the correct URL with a slash at the end. For example, trying to access http://example.com/content will result in a 301 response that will have the redirect location set to http://example.com/content/ .One incorrect symbol in the URL can almost double the loading time of a page in such cases.

Avoiding redirects provide the following Advantages:

  • Improved load speed
  • No Round-Trip Time
On this page...

    Optimized SSD Web Hosting

    • Free Domain Transfer
    • Google PageSpeed Enabled
    • 24/7 Technical Support
    • Fast SSD Storage
    • Hack-free Protection
    • Free Cloudflare CDN
    • Immediate Activation
    View More