I have a codeigniter website which has a broken link structure. The initial page loads normally. My Navbar looks like:
<a class="brand" href="#">myproject</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li ><a href="http://localhost/projectname/basecontroller/Facts">Facts</a></li>
<li ><a href="http://localhost/projectname/basecontroller/about">About</a></li>
<li ><a href="http://localhost/projectname/basecontroller/contact">Contact</a></li>
<!--<li ><a href="http://localhost/projectname/basecontroller/privacy">Privacy</a></li>-->
</ul>
</div><!--/.nav-collapse -->
I know this project worked correctly in the past . I believe it was deployed with a .htaccess file which is not present locally as I test it.
I've tested it with the following .htaccess file in the toot directory:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /projectname/index.php/$1 [L]
This appears to fix the directory structure by turning:
http://localhost/projectname/basecontroller/contact
into:
http://localhost/projectname/index.php/basecontroller/contact
but now all the js/css does not appear to be applied to the page ( I'm using bootstrap ).
The head of my pages looks like:
<!DOCTYPE html>
<html lang="en"><head>
<base href="http://localhost/projectname/">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>my title </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
How can I fix this?