I created a website. And the external stylesheet which I have linked to it is working perfectly on my system localhost. But when I upload it to the online server, it doesn't working. Because of this I have to add internal stylesheet which is waste of memory and execution time. I don't know what is the problem, the code is perfectly allright. I don't know how to fix this problem.
Here's the css link to my website:- - <meta charset="UTF-8">
-
<meta name="viewport" content="width=device-width" />
-
<link rel="icon" href="icon.png" type="image/png">
-
<link rel="stylesheet" type="text/css" href="style.css"/>
-
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
12 34866 Luuk 1,047
Recognized Expert Top Contributor
The problem is probably mixing HTTP and HTTPS.
Make sure that if your page is HTTP, the stylesheet is also HTTP.
Secure websites are not allowed to mix protocols. Everything has to be embedded from a secure server. Browsers will ignore/block HTTP resources on HTTPS pages (with varying degree of strictness).
Thank you fro your kind response. Can you please explain how to do this....
Luuk 1,047
Recognized Expert Top Contributor
First we have to know how you are going to your webpage, do you use HTTPS? of HTTP.
My guess is you use HTTTP.
If that is true, than change line #5 from 'https://...' to 'http://...'
Normally you should not do that (just change HTTP to HTTPS or the other way around), but this page is also reachable via HTTP, which you can check by typing this address in the address bar of a browser. then browser will respond with a download, and not give an error 404, which means the page exists.
Another approach to address this problem is to download the external css and then refer it with href.
Please let us know if this won't help.
Yet another approach is to use protocol relative URL references whereby you drop the protocol from the link entirely:
<link href="//fonts.googleapis...
The browser will then use the protocol that was used to load your page from your server to request the external resource.
It is useful if you happen to add a certificate later or change from a development to live scenario as you don't have to change anything.
Gaz
Luuk 1,047
Recognized Expert Top Contributor
But in the question was:
"Because of this I have to add internal stylesheet which is waste of memory and execution time."
How much time and memory will be wasted by putting this stylesheet locally?
Indeed.
Might I also suggest that the OP learn to use the developer console of their chosen browser as no doubt it would have indicated the mixed mode failure and is an invaluable tool regardless.
Gaz
but that link is provided by google fonts to import external fonts from google. If we remove the protocol from that link, then will it work properly?
Yes,
It is in the specification, which describes the mechanism browsers should use to fill in the blanks at the start of URLs to save developers retyping the full URL of every resource.
For example you may set an image URL to 'assets/images/someimage.jpg' but the browser will send the request for it to 'http://www.yoursite.com/assets/images/someimage.jpg' because the browser fills in the 'http://www.yoursite.com/' automatically.
However, where possible it's best to use HTTPS everywhere when live.
Gaz
yeah I think this might be helpful to me. I should try it once.
Thank you
Usually this is cache related. Try doing a hard refresh -- CTRL Shift R. Also, if you are using apache2, use the "-i" option. Files are not updating because they are cached. And if you cannot do this, change the href="styles.css" into href="styles.css?v=version2" (that's worked like a charm for my website when I faced the same issue). It would make the server think there is a new file, so then it updates the cache. Or you can always delete the old one and upload the new on.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: M P |
last post by:
Need help! Whats wrong with my code? My plan is this, I have my IIS5.0 on
Server A and then I will use SMTP service of Server B. I already configured
IIS to use Server B as its SMTP Server but I...
|
by: sirius |
last post by:
I have a simple database in ms access, one table with some 10-15 recordets.
When creating web page in asp (vbscript) on my local machine, which displays
the contents of access database, everything...
|
by: Brent |
last post by:
Hi,
I have a C# asp.net app. My validators all worked fine on 2000, and now I
moved my app to 2003 and the validators are not working. I added
if(!IsValid)
return;
as a workaround to my...
|
by: MajorTom |
last post by:
Hello group,
I need to know the best and best responsive way to determinate is a windows
form (or the desktop computer) is online (access to internet).
I particularly interested for a quick...
|
by: Paul de Goede |
last post by:
I set the Response.Filter in my aspnet application but I
have noticed that if you do a Server.Transfer that the
filter doesn't get called. And in actual fact the response
is mostly empty. It seems...
| |
by: Viswa Chamarti |
last post by:
Hello,
Need help in finding a solution.
One of our application is not working with application specific error after the upgrade of UDB client with service pack 14. Tried to connect to UDB...
|
by: =?Utf-8?B?a21pZGVhcw==?= |
last post by:
I'll be running SQL 2005 Standard on a box with Windows Server 2003
Enterprise. This is the database server for a number of websites, running on
a separate Windows 2003 server.
Do I need one or...
|
by: redblue |
last post by:
Hi all,
I have a question about making new html page on the server. such as i have a page and have space of heading,body, subject, and file name. if press the button then on the server new file...
|
by: quincy451 |
last post by:
drop table .
CREATE TABLE . (
NULL ,
(16) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
NULL ,
NULL ,
(16) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
(16) COLLATE
|
by: kkshansid |
last post by:
external javascript file not working on server
<script type="text/javascript" src="../include/common.js"></script>
while internal wrking fine
<script language="JavaScript">
.
.
</script>
i...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |