Tutorial by Examples

The RewriteEngine module within Apache is used to dynamically rewrite URLs and paths depending on various expressions provided: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...
.htaccess can be used to force your HTTP site to redirect to HTTPS. Here's a quick way that doesn't require editing the code for your domain: RewriteEngine On RewriteCond %{HTTPS} =off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Warning: The code above assumes that you can tr...
To enable Cross-Origin Resource Sharing (CORS) in Apache you'll need to set at least one HTTP header which changes it (the default behaviour is to block CORS). In the following example, we're going to be setting this HTTP header inside .htaccess, but it can also be set in your site your-site.conf fi...
The HTTP response status code 301 Moved Permanently is used for permanent URL redirection, meaning current links or records using the URL that the response is received for should be updated. The new URL should be provided in the Location field included with the response. The 301 redirect is consider...

Page 1 of 1