【发布时间】:2019-02-02 06:24:15
【问题描述】:
我有一个问题请...这是我在 Linux 主机中使用 CI 3x HMVC 的项目我有一个错误:
.htaccess是这个:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
Options -Indexes
### Redirigir la URL sin www a con www ###
RewriteCond %{HTTP_HOST} ^myserver.com
RewriteRule (.*) https://www.myserver.com/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^myserver.com [OR]
RewriteCond %{HTTP_HOST} ^www.myserver.com
RewriteRule (.*) https://www.myserver.com/$1 [R=301,L,QSA] #Falta www
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond $1 !^(index\.php|global|favicon\.ico|javascript)
在我的文件 config.php 中有这一行:
$config['base_url'] = 'https://www.myserver.com/';
当我在主“模块”(前面)中加载 https://www.myserver.com/ 时,我在所有表单中都看到了这种格式:
<form action="https://www.myserver.com/controllerxxxx" action="post"....
问题是当我加载https://www.myserver.com/admin 模块时...我在所有具有这种格式的表单中都看到...
区别在于“ADMIN”,我的 base_url 是 https://myserver.com/ 没有 WWW。
怎么了?你能帮帮我吗?
我需要解决这个问题,并将我的 URL 服务器与 WWW 放在 Front 和 Admin 模块中。
谢谢!
【问题讨论】:
标签: codeigniter mod-rewrite hmvc-codeigniter .htaccess