我正在测试网络示例...我在这个方向上创建了一个联系表单,您可以尝试发送电子邮件,然后查看inspect-console或inspect-network:
http://www.novaderma.cl/site2/
它给出了错误404,“在此服务器上找不到请求的URL”...我不知道发生了什么......这里是.htacces文件,请帮助我!!
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>
答案 0 :(得分:1)
在根目录中的htaccess文件中添加此重写规则
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
同样在codeigniter Config文件夹中 - &gt; autoload.php文件添加url helper:
$autoload['helper'] = array('url');
答案 1 :(得分:0)
您必须使用htaccess文件中的代码...
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase //
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>