What I want to achieve is, that my site support pretty url and whatever the user types in, I want it to be redirected to https://website.com/{queries}.So I am doing it like below, but I am new to these stuff so do you guys see any concerns?#pretty url => http://website.com/folder/posts/parameterRewriteEngine onRewriteRule ^posts/([^/.]+)/?$ /folder/posts.php?v=$1 [L]#drop .php in urlRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^([^\.]+)$ $1.php [NC,L]#rewrite to HTTPS:RewriteCond %{HTTPS} offRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]#drop www from urlRewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [R=301,QSA,NC,L]#enable gzip compression for these objects<IfModule mod_filter.c>    AddOutputFilterByType DEFLATE application/atom+xml \                                  application/javascript \                                  application/json \                                  application/ld+json \                                  application/manifest+json \                                  application/rdf+xml \                                  application/rss+xml \                                  application/schema+json \                                  application/vnd.geo+json \                                  application/vnd.ms-fontobject \                                  application/x-font-ttf \                                  application/x-javascript \                                  application/x-web-app-manifest+json \                                  application/xhtml+xml \                                  application/xml \                                  font/eot \                                  font/opentype \                                  image/bmp \                                  image/svg+xml \                                  image/vnd.microsoft.icon \                                  image/x-icon \                                  text/cache-manifest \                                  text/css \                                  text/html \                                  text/javascript \                                  text/plain \                                  text/vcard \                                  text/vnd.rim.location.xloc \                                  text/vtt \                                  text/x-component \                                  text/x-cross-domain-policy \                                  text/xml</IfModule>And something specific I was not sure about is when dropping the www in url. Should I use RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]or RewriteCond %{HTTPS_HOST} ^www\.(.*)$ [NC]as my site is in https?
htaccess file for pretty URLs and HTTPS redirects
url routing;.htaccess