I am uploading a bootstrap template through Heroku. The name of the template is: Brushed. http://www.alessioatzeni.com/blog/brushed-template/
I route to the home page through a php file with the following code:
<?php include_once("home.html"); ?>
Everything works in the emulator on cloud9, however, when I upload it to Heroku only my HTML shows up without any of my CSS. Does anyone have any idea of what I can do?
Here is a link to my site: https://mariatorres.herokuapp.com/
It is not a rails app, just a static bootstrap template.
If you use Chrome's Code Inspector and go to Network, and try to reload your webpage, you will see that the .css files are 404 not found... you can reproduce the same if you load your webpage, open it's source and see (and try to open) the .css links.. you will see that they are not found. To fix this, where you load the .css files try to use the full path of the CSS, or if you rewrite/route your paths, fix the path to the CSS files..
Only by showing us the include statement, is not enough..
Related
I started working on a wordpress website locally after downloading the wp-content folder from an existing website.
CSS styling is working alright but images (and fonts) are not displayed for some reason.
Both those things are assests fetched using url() in CSS but I don't understand why it happens. Obviously everything works the way it's supposed to on the live site.
images are in the theme folder:
wp-content/themes/myTheme/assets/pageName/img.ext
And through CSS I try to access them using:
background-image: url("/wp-content/themes/myTheme/assets/pageName/img.ext")
What am I doing wrong?
The solution to my problem was to extend the path by adding "/wordpress/" like so:
background-image: url("/wordpress/wp-content/themes/myTheme/assets/pageName/img.ext")
I am developing my Wordpress theme from scratch and when I link my bootrap.css in my index.php file and then I go see what it looks like it did not work. Please if someone can help.
Do you have a link to the site that you're working on? I'd love to help but really need to see what you're doing. Here are a couple things you can try:
link bootstrap.css in the header.php template file. As long as the directory path is correct, you should be able to 'view source' on the page and click on the file link to confirm that the file's content has been loaded.
Don't forget that for bootstrap, you also need to load jquery (http://jquery.com/download/) as well as link to the bootstrap.js file. I usually link to jquery and the bootstrap.js file in the footer.php template file for your theme.
You can also always refer back to this basic template which bootstrap provides that should help you get started.
http://getbootstrap.com/getting-started/#template
I am just trying to host a laravel site to production. There is an error with the routing all my css and javascript files are being treated like a route instead of files and they are not loading
<script src='http://project.com/project/assets/js/jquery-1.9.1.js' type='application/javascript'></script>
I can see that this html is generated but the files are not being loaded When I click on the link I get a NotFoundHttpException
This is wroking fine in my local machine. This error is present only in live server.
Thanks in advance!
The src link to your js file is set using Laravel's HTML::script()? If not change it because this will help so that you can have proper full urls for js and css files. So if you have a js file like public/assets/js/custom.js you should call it like this:
{{ HTML::script('assets/js/customs.js') }}
and you will be fine. Just remember that your starting point for assets is inside public folder. HTML::script() or HTML::style() get you there at once.
It turns out the issue is with nginx configuration. The root folder to the server was set incorrectly. So it was looking for differnt files. Not a code issue just and issue with the server environment
I'm having a problem with CakePHP, the CSS is not found. When I view the source code in my browser I can see the cake generic CSS link in the head section. But when I click on it to see the actual source code, I get a 404 not found error.
i follow this actions:
uncommented
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
in app/config/core.php , because rewrite module is disable.
delete .htaccess file from / and /app and /app/webroot.
run project.
php code in default is :
app/View/Layouts/default.ctp
echo $this->Html->css('cake.generic');
and its html code is:
<link rel="stylesheet" type="text/css" href="/app/webroot/css/cake.generic.css" />
this file exist really, but when i click to /app/webroot/css/cake.generic.css in source of browser code i face
404 Not Found
Is way?
I'm assuming your virtual hosts document root points to app/webroot so your links to the css files need to point to /css/file.css. The way you have it now it's actually looking for app/webroot/app/webroot/css and that's why you get a 404.
Either that or your .htaccess is wrong or you stylesheet doesn't actually exist. Let me know if this helps and i can update my answer if needed.
Already,i face this problem. i change permission for app and webroot and css folders. i offer this for you too.
I'm trying to use the uaparser.php library to detect the operating system, but when I use the following it just loads the github page for the library. This is the github page https://github.com/tobie/ua-parser/tree/master/php
<?php
require('uaparser.php');
?>
I've placed the file in my includes folder which resides in the Views directory. Perhaps, that is the source of the problem? Where would be an appropriate place to put this file?
I assume when you downloaded uaparser.php you clicked File->Save Page As... (or something simular). That is why the page loads when you require/include it.
Open up the local file uaparser.php and confirm that it is actually the php code and not the html of the page.
Doing this is fine anywhere you need it.
You can place this anywhere, but for codeigniter it should be in the 3rd party folder, but it doesn't matter.