我試圖測試codeigniter proyect託管;它的渲染沒有問題的索引頁,但我有一個聯繫表格,通過ajax請求發送數據,在這裏:Codeigniter阿賈克斯調用404錯誤託管
$('#send_mail').submit(function(e) {
e.preventDefault();
$.ajax({
url: baseurl+'email/send',
type: 'POST',
dataType: 'json',
data: $(this).serialize()
})
.done(function() {
console.log("success");
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
});
當我提交的聯繫方式,我得到這個錯誤:
POST http://novaderma.cl/site/email/send 404 (Not Found) jquery.min.js:4
我一直在尋找在網絡上和其他人都與.htacces
文件和base_url
參數類似的問題,所以我會後他們也一樣,在這裏:
配置文件
$config['base_url'] = 'http://novaderma.cl/site/';
$config['index_page'] = 'index.php';
的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /site/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
我不知道如何解決這個問題,所以請幫助我!
的可能的複製[IIS 7 URL重寫(http://stackoverflow.com/questions/14290837/ iis-7-url-rewriting) – Vaviloff
您的服務器在Windows上的IIS上工作,所以.htaccess不會幫助,因爲它適用於Apache服務器。請參閱上面的URL以解決您的問題。 – Vaviloff
Hi @Vaviloff! ,請你幫我解決這個問題嗎?我無法理解它。 –