【发布时间】:2017-01-08 21:17:32
【问题描述】:
如何使用 htaccess 实现所有这些。到目前为止,我已经--
RewriteEngine On
删除 index.php
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
强制 SSL 和非 www 到 www
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{HTTP_HOST} !^(www|abc|cde|efe) [NC] #Subdomain abc and cde
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
知道它为什么会发生,但无法找出一个规则来组合我需要的一切并使其发挥作用。
需要强制 https 并删除 index.php 和非 www 到 www。 答案将不胜感激并提前感谢
【问题讨论】:
-
您的托管服务提供商的名称是什么????
-
www.ifsc-bank.com
-
我的托管服务提供商是 unionhost.com
-
请打开 config.php 文件并找到 $config['uri_protocol'] 并设置 $config['uri_protocol']="REQUEST_URI" 。
标签: php apache .htaccess codeigniter