In Php when I try to load the page and this error appears in the console: GET http://localhost/bootstrap.min.css net::ERR_ABORTED 404 (Not Found). || js and css don't work on my web page
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home Page</title>
<link rel="stylesheet" href="/bootstrap.min.css">
<link rel="stylesheet" href="/style.css">
</head>
but the path is correct, even though i had a 404 problem...
what'the problem?
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
In CDN It worked, but in local files(downloaded files) not worked.
Related
I have a very basic webpage with two files, index.php and style.css
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<script language="JavaScript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
Example text
</body>
</html>
body {
text-align: center;
}
If I navigate to www.example.com this page loads correctly. WAMP automatically takes me to index.php. However if I navigate explicitly to www.example.com/index.php the css fails and everything reverts back to the default of being left-aligned.
EDIT: I originally blamed this on a GET variable but I have realised that's not the issue
Here is the title and link I used with the header, but I just get the word "Document" instead
<title>Chicken and Waffle | Local 360 | Gunyen</title>
<link rel="shortcut icon" type="image/png" href="images/gunyen%20logo%20dark.png">;
sample: https://gunyen.com/post/local360chknnwfl.php
What am I doing wrong?
Check your code again! This is the page source code I see in my browser:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="docsearch:language" content="en">
<meta name="docsearch:version" content="4.3">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel="shortcut icon" type="image/png" href="images/gunyen%20logo%20dark.png"/>
<!--https://developers.google.com/search/reference/robots_meta_tag#directives-->
<!--<meta name="robots" content="index, follow, archive">-->
<meta name="robots" content="nofollow, noindex">
...
As you can see, there are 2 head blocks!
Most browsers will pick up favicon.ico from the root directory of the site without needing to be told; but they don't always update it with a new one right away.
However is a correct way to achieve your task with the name of favicon.ico:
<link rel='shortcut icon' type='image/x-icon' href='images/gunyen/logo/favicon.ico' />
Reference: https://stackoverflow.com/a/9943834/6366593
I have a Wordpress website with a custom theme. Everything works fine on index.php but when I create one more page (index2.php or adminpage.php) and try to load that in-browser WordPress will redirect me to index.php
OK, this is file setup: https://ibb.co/9n7Qdxt . This is URL of normal index.php: https://ibb.co/M69f5bD . And this is a problem: https://ibb.co/kJFW4ZZ
ps: adminpage.php is empty but browser load index.php
image: https://ibb.co/x2T82dc
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
<link rel="icon" href="favicon.ico">
<link rel="icon" href="favicon.png">
<title></title>
<?php wp_head(); ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Libre+Franklin:100,100i,200,200i,300,300i,400,400i,500,500i" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
</head>
PRoblem: Wordpress always redirects the user to index.php regardless which url user enter ...
From what you've described you haven't added the adminpage.php as a template file and assigned it to a page in the backend. Here's a link to help you with template theming in WordPress.
https://developer.wordpress.org/themes/basics/template-hierarchy/
I need to redirect a page whilst keeping the original page (not the one redirected to) share title and description and icon.
So in this example, the share preview in Whatsapp etc would say Title rather than Google.
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Title</title>
<meta name="description" content="Download now">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
</head>
<body>
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: google.com");
?>
</body>
</html>
I've added the code
<meta name="viewport" content="width=device-width, initial-scale=1" />
to the HEAD of my webpage the Index.php at DuchyBrass.co.uk
It is on Line 6 of the source code, but the site runs on a bespoke CMS so the HEAD is defined in its own file and imported.
index.php
<!DOCTYPE html>
<html lang='en'>
<head>
<?php include 'app/common/head.php'; ?>
</head>
<body>
...
head.php
<title>Duchy Brass</title>
<meta charset="windows-1252" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="google-site-verification" content="QsU348JA47VLcAbTUic-Un90bVlGuVk3a9A34doxsvc" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href='http://fonts.googleapis.com/css?family=Viga' rel='stylesheet' type='text/css'>
<link rel="icon" type="image/png" href="imgs/favicon.ico">
<link rel="canonical" href="http://www.duchybrass.co.uk" />
As far as the browser is concerned (I assume) that viewport tag is visible, but it is not seen by that Mobile SEO tool. Is this something to do with the CMS, loading the information too late, or is this a common issue that I should ignore?
The top of my Index page (using view page source from the browser) looks like
/ (page source)
<!DOCTYPE html>
<html lang='en'>
<head>
<title>Duchy Brass</title>
<meta charset="windows-1252" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
...
TL;DR: clear caches and check if there is no content before head (ctrl+U)
I had a similar problem, in my case there were content being included trough PHP before my wordpress header call,
check it with Ctrl+U (see source) and be sure there is nothing before the
<!DOCTYPE html>
<html lang='en'>
<head>
if you change the code and it persists, check if you're using cache, you may have to clear caches of pages and files so the changes take effect before running another PageSpeed analysis