如何修改我的.htaccess以从url';s
My.htaccess正在删除index.php,目前还强制使用https,我如何修改它以从url中删除www,因为带有www的url会导致我的ssl证书失败如何修改我的.htaccess以从url';s,.htaccess,.htaccess,My.htaccess正在删除index.php,目前还强制使用https,我如何修改它以从url中删除www,因为带有www的url会导致我的ssl证书失败 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] RewriteCond %{HTTPS} off
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
<IfModule mod_php5.c>
php_extension openssl.so
</IfModule>
重新编写引擎打开
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
重写条件%{HTTPS}关闭
重写规则^(.*)$https://%{SERVER_NAME}%{REQUEST_URI}[R=301]
php_扩展openssl.so
上次重写后添加此项
RewriteCond %{HTTP_HOST} ^www.%{SERVER_NAME}$ [NC]
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
替换此项:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
与:
将“example.com”替换为您的服务器名
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ https://example.com%{REQUEST_URI} [R=301]