Redirecting http to www and https page

Edit .htaccess as follows:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,QSA,L]

It helped me to show icons on the front page correctly at a site running wordpress.

And add these below in order to recirect http to https page.

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R=301,L]

And for hiding index.php in the url

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

Redirect to subdirectory

RewriteRule ^(/)?$ puvodni

How to hide .html, .htm or .php extension at URL

  1. Create .htaccess file in the root directory of your web.
  2. Write into the file:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.html [NC,L] - FOR HTML ONLY
    RewriteRule ^([^\.]+)$ $1.php [NC,L] - FOR PHP ONLY
  3. Save the file.
  4. Adjust all hyperlinks on your website – delete all html (htm) and php extensions.
  5. Done.