Дописываю руками перед именем домена www получается адрес - https://www.site.com
и меня редиректит на https://site.com/frontend/web/
Дописываю в .htaccess в конец файла строчки:
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,NE,R=301]
ни чего не меняется.
Помогите решить задачу, как на Yii2 проекте настроить редирект с URL с www - на URL без www, если сайт работает на https
Вот мой .htaccess
Код: Выделить всё
AddDefaultCharset utf-8
#AuthType Basic
#AuthName "enter"
#AuthUserFile /var/www/vhosts/finrada.cz/httpdocs/.htpasswd
#Require valid-user
RewriteEngine on
#RewriteRule sitemap.xml sitemap.xml [L]
#RewriteRule google48af8b661be8efac.html google48af8b661be8efac.html [L]
#RewriteCond %{REQUEST_URI} !^/(backend/web|manager)
#RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
# redirect to the page without a trailing slash (uncomment if necessary)
#RewriteCond %{REQUEST_URI} ^/manager/$
#RewriteRule ^(manager)/ /$1 [L,R=301]
# the main rewrite rule for the backend application
RewriteCond %{REQUEST_URI} ^/manager
RewriteRule ^manager(.*) /backend/web/$1 [L]
RewriteCond %{REQUEST_URI} ^/storage
RewriteRule ^storage(.*) /storage/web/$1 [L]
# �������� ������ ������ /frontend/web/$1
RewriteCond %{REQUEST_URI} !^/(frontend/web|backend/web|manager|storage)
RewriteRule (.*) /frontend/web/$1
# if a directory or a file of the frontend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /frontend/web/index.php [L]
# if a directory or a file of the backend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /backend/web/index.php [L]
# if a directory or a file of the backend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/storage
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule . /storage/web/index.php [L]
RewriteCond %{REQUEST_URI} \.(htaccess|htpasswd|svn|git)
RewriteRule \.(htaccess|htpasswd|svn|git) - [F]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,NE,R=301]