WordPress.org

Ready to get started?Download WordPress

Forums

404 error on external pages (6 posts)

  1. lewischeney
    Member
    Posted 1 year ago #

    Hi,

    I have quite a strange issue. If I create a new file in a folder in my theme folder, I try and visit the page and get a page not found, although some older files work.

    http://rockwoodmaple.com/wp-content/themes/extranews/adzones/

    This is a good example of it. If you click homepage_subgrid.php, you'll get an error but if you click footerzone.php you're fine.

    NOTE: The page you get with a grey background is a Gatekeeper page for the main domain on the install. If you're logged in as an admin, it does actually show a 404.

    Any ideas?

    Thanks

  2. Well... You're not supposed to be hitting those directly for what it's worth.

  3. lewischeney
    Member
    Posted 1 year ago #

    Why not? I've created these files to include them in the template. No matter where I place the file, it cannot be found.

    It's clearly an error though.

  4. The pages CAN be found, I click on them and get a page. I suspect the logged in thing is because of the code on the page.

    but do you understand how templates work? WP calls them, internally.

    You can see http://ipstenu.org/wp-content/themes/twentytwelve/style.css but you can't see this: http://ipstenu.org/wp-content/themes/twentytwelve/author.php (the error is because I don't like people snooping)

    Now youCAN in SVN: http://themes.svn.wordpress.org/twentytwelve/1.1.1/author.php

    The point is, you're never meant to hit those URLs directly. So why are you trying to? What proof of concept test is this for?

  5. lewischeney
    Member
    Posted 1 year ago #

    My point is that some pages can be seen, others can't. For example, homepage_subgrid.php doesn't work but footerzone.php does.

    The issue is this: because my WP is installed in my root directory, any time I try and put a file anywhere, it 404's. I don't know if this is my server or something to do with the way WP is setup.

    I have various ad code that is used in different places across the site. I want to put it into a PHP file, and include that file in the different places, so as not to duplicate code. Some files have worked, as I said, others 404.

  6. My point is that some pages can be seen, others can't. For example, homepage_subgrid.php doesn't work but footerzone.php does.

    Yes, but that doesn't MEAN anything :) I'm serious, it really doesn't have any bearing on if WP works or not. It's a pointless error. It;s like ... "My car has a door." Okay. So?

    The issue is this: because my WP is installed in my root directory, any time I try and put a file anywhere, it 404's. I don't know if this is my server or something to do with the way WP is setup.

    THAT is a totally different situation (I know you're thinking "But, Ipstenu you fool, themes is a folder on my server! It's the same!" and you'd be right except that themes are special, so we have to exclude it from this equation).

    Lets break it down.

    1) You aren't SUPPOSED to be able to 'see' the files in wp-content/themes, they are for being rendered by WP only. If you try to view them directly, they won't work.

    2) You say ANY file you ad 404s? Let's test. http://rockwoodmaple.com/readme.html works, so make a readme2.html file in the same location and see if that works.

    3) You want to add ads to WP (say that ten times fast). You can either edit all your themes or use hooks. But either way, if you edit your theme you won't see the ads in the files, but on your site when you visit http://rockwoodmaple.com/somepagehere

    So if you put the ad in footer.php, then you will only see it when you visit the actual site, not that page. It's just how themes work.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags