简体   繁体   中英

Working codeigniter (xampp) won't work live - .htaccess or index.php?

I'm working on a project on my work and try to get it online now.

When I run my project in xampp it works fine but when I run it online I see "404" in my browser tab. This is the response I get:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keyword" content="">
    <link rel="shortcut icon" href="img/favicon.png">

    <title>404</title>

    <!-- Bootstrap core CSS -->
<!--    <link href="--><!--assets/bs3/css/bootstrap.min.css" rel="stylesheet">-->
    <link href="

So it stops from the first php opening tag in that error_404.php file that i use for the a href.

This is my .htaccess in the root:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /folder/index.php/$1 [L]

The BASEPATH is: /var/www/vhosts/(domain_name).nl/(domain_name).eu/dashboard/system/ I think it must be: (domain_name).eu/dashboard/system/ Or am i wrong?

Try using this as .htaacess:

 RewriteEngine on

 # enable the directives - assuming they're not enabled globally
 ExpiresActive on

 # send an Expires: header for each of these mimetypes (as defined by server)
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"

 # css may change a bit sometimes, so define shorter expiration
 ExpiresByType text/css "access plus 1 days"

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

I found the solution here.. Unable to access codeigniter controller in Live Server but accessible in localhost (xampp on windows)

tnxs jah

I forgot a couple off uppercases. Sorry guys..shame on me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM