Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Different ways of doing this. Complete rewrite or file based. We'll cover both but the recommended approach is to use rewrite which covers not just the main index file but all scenarios.

There is a third scenario, which is if you having your CDN (Content Deliver Network) like Akamai host the redirects. The advantage with a CDN is the faster (done on the edge servers serving your content) and which also remove the load from your web servers.

Note

Further reading from Apache seems to say this is Rewrite is NOT the right approach and to use Redirect instead,

A common use for RewriteRule is to redirect an entire class of URLs. For example, all URLs in the /one directory must be redirected to http://one.example.com/, or perhaps all http requests must be redirected to https.

These situations are better handled by the Redirect directive. Remember that Redirect preserves path information. That is to say, a redirect for a URL /one will also redirect all URLs under that, such as /one/two.html and /one/three/four.html.

BUT all over the internet people recommend Rewrite...

...