Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

trifek's avatar

.Htaccess index php / html redirect to main page

I have this .htaccess. I would like:

That he would direct from www.domena.pl to domena.pl (I have it done) to always point to https after entering domena.pl/index php or index html -> redirected to https domena.pl How can I make it?

My htacess:

  RewriteEngine On
     # Redirect to non www
     RewriteCond% {HTTP_HOST} ^ www.domena.pl $ [NC]
     RewriteRule ^ (. *) $ Https://domena.pl/ [R = 301, L] 

Please help

0 likes
0 replies

Please or to participate in this conversation.