Category: Content Management System

Htaccess file for WordPress

Created at: 2019-08-12 16:50:18 Updated at: 2019-08-13 11:02:44

in Apache, Wordpress

    ### Htaccess file for WordPress project.
    # 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]
    # END WordPress

If you want to force http request to https then add following code after RewriteEngine on

    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]