theme development - Style.css redirects to 404 Page not found

admin2025-06-03  2

I've just uploaded a wordpress site from MAMP to a live site. Exactly the same methods I usually use to upload them, including permalinks and all the usual PHPMyAdmin bits.

This time the style.css, js and all the images are just redirecting to a 404 page.

The website is here

Can anyone help? This makes no sense at all.

EDIT: heres a snippit of header.php:

<!DOCTYPE html>
<html lang='en'>
    <head>
        <!-- Version 1.0 of Ken Christys Rural Support Website -->
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>
        <meta content='<?php bloginfo( 'description' ); ?> ' name='description'>
        <meta content='' name='keywords'> 
        <script>
            if(!window.jQuery)
                {
                     var script = document.createElement('script');
                     script.type = "text/javascript";
                     script.src = ".1.0/jquery.min.js";
                     document.getElementsByTagName('head')[0].appendChild(script);
                }
        </script>


        <!-- Google Analytics-->

        <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/pace.js"></script>
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

        <title>
            <?php echo get_the_title() . "  -  ". get_bloginfo ( 'description' );  ?><br />
            <!-- Current Page title - Website description -->
        </title>



    </head>

and here is the actual rendered code:

<!---->
<!DOCTYPE html>
    <html lang='en'>
    <head>
        <!-- Version 1.0 of Ken Christys Rural Support Website -->
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>
        <meta content='Ken Christy Rural Support ' name='description'>
        <meta content='' name='keywords'> 
        <script>
            if(!window.jQuery)
                {
                     var script = document.createElement('script');
                     script.type = "text/javascript";
                     script.src = ".1.0/jquery.min.js";
                     document.getElementsByTagName('head')[0].appendChild(script);
                }
        </script>


        <!-- Google Analytics-->

        <script type="text/javascript" src=".js"></script>
        <link rel="stylesheet" type="text/css" media="all" href=".css" />

        <title>
            Home  -  Ken Christy Rural Support<br />
            <!-- Current Page title - Website description -->
        </title>

I've just uploaded a wordpress site from MAMP to a live site. Exactly the same methods I usually use to upload them, including permalinks and all the usual PHPMyAdmin bits.

This time the style.css, js and all the images are just redirecting to a 404 page.

The website is here

Can anyone help? This makes no sense at all.

EDIT: heres a snippit of header.php:

<!DOCTYPE html>
<html lang='en'>
    <head>
        <!-- Version 1.0 of Ken Christys Rural Support Website -->
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>
        <meta content='<?php bloginfo( 'description' ); ?> ' name='description'>
        <meta content='' name='keywords'> 
        <script>
            if(!window.jQuery)
                {
                     var script = document.createElement('script');
                     script.type = "text/javascript";
                     script.src = "http://ajax.googleapis/ajax/libs/jquery/2.1.0/jquery.min.js";
                     document.getElementsByTagName('head')[0].appendChild(script);
                }
        </script>


        <!-- Google Analytics-->

        <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/pace.js"></script>
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

        <title>
            <?php echo get_the_title() . "  -  ". get_bloginfo ( 'description' );  ?><br />
            <!-- Current Page title - Website description -->
        </title>



    </head>

and here is the actual rendered code:

<!---->
<!DOCTYPE html>
    <html lang='en'>
    <head>
        <!-- Version 1.0 of Ken Christys Rural Support Website -->
        <meta charset="utf-8">
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <meta content='Josh Stevens, Lyndsay Hooper, PotatoMou.se' name='author'>
        <meta content='Ken Christy Rural Support ' name='description'>
        <meta content='' name='keywords'> 
        <script>
            if(!window.jQuery)
                {
                     var script = document.createElement('script');
                     script.type = "text/javascript";
                     script.src = "http://ajax.googleapis/ajax/libs/jquery/2.1.0/jquery.min.js";
                     document.getElementsByTagName('head')[0].appendChild(script);
                }
        </script>


        <!-- Google Analytics-->

        <script type="text/javascript" src="http://www.kenchristy-ruralsupport/wp-content/themes/KenChristy/javascript/pace.js"></script>
        <link rel="stylesheet" type="text/css" media="all" href="http://www.kenchristy-ruralsupport/wp-content/themes/KenChristy/style.css" />

        <title>
            Home  -  Ken Christy Rural Support<br />
            <!-- Current Page title - Website description -->
        </title>
Share Improve this question edited Apr 21, 2014 at 17:34 Josh asked Apr 21, 2014 at 16:44 JoshJosh 731 gold badge1 silver badge11 bronze badges 17
  • Did you flush your permalinks? – Pieter Goosen Commented Apr 21, 2014 at 16:49
  • Yes, as I mentioned originally, I've done all the usual bits. – Josh Commented Apr 21, 2014 at 16:50
  • What code is actually outputting the stylesheet that is returning the 404? Please post the relevant code from header.php or functions.php. – Chip Bennett Commented Apr 21, 2014 at 16:56
  • header.php - <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/pace.js"></script> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> – Josh Commented Apr 21, 2014 at 16:57
  • 1 As @PieterGoosen said: please edit your question to include the code that produces the output, as well as the actual output rendered by that code. – Chip Bennett Commented Apr 21, 2014 at 17:16
 |  Show 12 more comments

4 Answers 4

Reset to default 6

Your directory permissions for your Theme directory are incorrect.

  • wp-content: 0755
  • wp-content/themes: 0755
  • wp-content/themes/kenchristy: 0700

Per the Codex, folder permissions should be set to 755:

In such an suexec configuration, the correct permissions scheme is simple to understand.

  • All files should be owned by the actual user's account, not the user account used for the httpd process.
  • Group ownership is irrelevant, unless there's specific group requirements for the web-server process permissions checking. This is not usually the case.
  • All directories should be 755 or 750.
  • All files should be 644 or 640. Exception: wp-config.php should be 600 to prevent other users on the server from reading it.
  • No directories should ever be given 777, even upload directories. Since the php process is running as the owner of the files, it gets the owners permissions and can write to even a 755 directory.

So, try changing wp-content/themes/kenchristy/ from 0700 to 0755.

replace

  <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /       

with

 <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" />

also try placing your style above all your JS

Your call to wp_head between <head></head> is missing. Just before </head> add <?php wp_head(); ?>Then, enqueue your scripts and stylesheets properly in your functions.php. Have a look at the following from the codex

wp_enqueue_scripts wp_enqueue_style() wp_enqueue_script()

I had a folder named /CSS but was referencing /css in my enqueue. This was no problem on local, but the URLs were case sensitive when I pushed it up to hosting

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748959497a315167.html

最新回复(0)