- How to exclude a specific folder from rewrite rule in htaccess
- WordPress htaccess
- Default WordPress .htaccess File
- How to Leverage Browser Caching for Images, CSS and JS in .htaccess
- How to remove file extension from a url
- Redirect www to non-www and vice versa
Redirect entire website to any other domain
301 (Permanent) Redirection
Redirect 301 / http://hostbriz.com/
302 (Temporary) Redirection
Redirect 302 / http://hostbriz.com/
Redirect file to a specific file/domain/directory/folder
Redirect file to domain
Redirect /index.html https://healthproclub.com/
Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
Redirect /old to /new directory
RewriteRule ^old/(.*)$ /new/$1 [R=301,NC,L]
Set the default index extension
DirectoryIndex index.html
Set redirect except condition RewriteCond
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/index.php RewriteCond %{REQUEST_URI} !^/fss RewriteRule (.*) https://journals.healthproclub.com/$1 [R=301,L]
Redirect 404 Error pages to homepage
ErrorDocument 404 https://bdhostit.com/
Redirect non-existing page(s) to index.php
Options +SymLinksIfOwnerMatch RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
Redirect everything to https://hostbriz.com
RewriteEngine on RewriteRule ^(.*)$ https://hostbriz.com/$1 [R=301,L]
Redirect a directory to
RewriteRule ^journal/(.*)$ https://hostbriz.com/$1 [R=301,NC,L]
Redirect all sub domains to main domain with www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirect all sub domains to main domain without www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirect www, non-www, http to https without www
RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC] RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]