I have application based on PHP and Apache. If requested link is not directory or file, all requests go to index.php file. I wanna redirect all requests from http to https and without www.
Valid link for me:
Started from following links invalid for me(sorry my reputation is very small and i cant post more 2 links):
My htaccess looks like that
AddDefaultCharset UTF-8
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [L]
How i can do redirects to https and without www?
Have another rule for http->http
and www
removal:
AddDefaultCharset UTF-8
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://someaddress.org%{REQUEST_URI} [L,NE,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments