Every Url redirect to one page
1 2 3 4 |
Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^(.*)$ https://yoursite.com/ [R=301,L] |
1 2 3 4 |
Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^(.*)$ https://yoursite.com/ [R=301,L] |
WORDPRESS
1 2 3 4 5 6 7 8 |
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] |
HTML WEBSITE WWW
1 2 3 4 5 6 7 |
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{HTTPS} !=on RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] |
HTML WEBSITE NON-WWW
1 2 3 4 5 6 7 |
RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteCond %{HTTPS} !=on RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] |
1 2 3 4 |
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L] |
1 2 3 |
RewriteEngine On RewriteCond %{HTTP_HOST} !^domain\.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] |
1 2 3 4 |
RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.olddomain.com$ RewriteRule (.*)$ http://newdomain.com/$1 [R=301,L] |
1 2 3 4 5 6 |
# Browser Caching FileETag MTime Size <IfModule expires_module> ExpiresActive on ExpiresDefault "access plus 1 week" </IfModule> |
1 2 3 4 5 6 7 8 9 10 11 |
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress |