Remove the www from the URL:
If a persone enter www.example.com, you want them to be redirected to example.com
Ensure the use of HTTPS:
If a persone try to access your website using "http://" instead of "https://" you want them to be automatically redirected to the secure version with "https://." yeh isn't ?
To do this, create or edit your .htaccess file and add the following lines:
RewriteEngine On
1)----> Redirect https://example.com/$1eCond %{HTTP_HOST} ^www. [NC] RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]`
2)------> Redirect HTTP to HTTPS
RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
3)----->Route all requests to index.php
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
Make sure to replace "example.com" with your own domain name.
These rules will redirect visitors to the non-"www" version of your website and ensure that they are using the secure HTTPS protocol. Additionally, it will preserve the specific page or location they are trying to access.