当我点击网址 https://www.domainname.com/welcome 时。它给了我 404 错误和
当我打 https://www.domainname.com/Welcome 它工作正常时。我的控制器名称和文件名是大写字母,下面是我的htaccess。
请让我知道我哪里出错了。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
提前谢谢。
我从这个链接得到了解决方案。在哪里你可以找到类似的解决方案问题。
希望这将有助于修复您的404错误。
代码点火器上传到服务器后抛出 404
你会尝试一次吗?
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /folder/index.php/$1 [L]
你可以
使用它。
在配置中.php
$config['base_url'] = 'your base url';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
在 .htaccess 中(这应该放在应用程序文件夹之外)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
在自动加载中.php
$autoload['helper'] = array('url');
使用"vhosts.conf"文件夹。URL 可以设置为敏感大小写。位置 :/var/www/vhosts/domain.com/conf/vhosts.conf
重写引擎开启重写映射 小写 int:tolower重写康德 $1 [A-Z]重写规则 ^/(.*)$/${小写:$1} [R=301,L]
您必须在配置文件夹的路由页面上为此创建路由。对于前
$route["welcome-page"] = 'Welcome';
并像这样称呼您的页面 - https://www.domainname.com/welcome-page
希望这段代码对您有所帮助。
嗨,
在本地工作时遇到了同样的问题,我上传到了亚马逊 Ec2 服务器。我得到的解决方案是:制作所有控制器和模式