I'm trying to test a codeigniter proyect on hosting; the index page it's rendering without problems, but I have a contact form that sends data via an ajax request, here:
$('#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");
});
});
When I submit the contact form I'm getting this error:
POST http://novaderma.cl/site/email/send 404 (Not Found) jquery.min.js:4
I've been searching on the web and other people have similar problems with the .htacces
file and base_url
parameter, so I'm gonna post them too, here:
Config file
$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>
I don't know how to solve this, so please help me !!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…