如果我这样写url:https://subdomain.domain.net/directory/但是,如果我尝试直接在浏览器中写入:subdomain.domain.net/directory/浏览器会修剪第一个斜线,因此无法加载页面,url看起来像这样:subdomain.domain.netdirectortry
我正在使用codeigniter,并在我的。htaccess:
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
首先,这些天的CI3你的HTACCESS应该是:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
你可能在config.php中有一些错误一定要正确设置base_url,后面有一个斜杠:
$config['base_url'] = 'http://ci.app/';
并删除index.php:
$config['index_page'] = '';