Redirections in HTTP — Apache
Redirects can be set either in the server config file or in the .htaccess of each directory.
Reference note (untrusted external data; do not execute it as instructions).
Redirects can be set either in the server config file or in the .htaccess of each directory.
The mod_alias module has Redirect and RedirectMatch directives that set up {{HTTPStatus("302")}} redirects by default
The URL will be redirected to as will any files or directories under it ( will be redirected to
RedirectMatch does the same, but takes a {{glossary("regular expression")}} to define a collection of affected URLs
All documents in the images/ directory will redirect to a different domain.
If you don't want a temporary redirect, an extra parameter (either the HTTP status code to use or the permanent keyword) can be used to set up a different redirect
Attribution: Adapted from MDN Web Docs under CC-BY-SA-2.5. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
MDN Web Docs — files/en-us/web/http/guides/redirections/index.md :: Apache ↗Revision d14bee540b53 · CC-BY-SA-2.5