Grow your CSS skills. Land your dream job.

WordPress 404

  • # June 24, 2013 at 9:20 pm

    I’ve created a custom 404.php for me theme but when I try to view on my local machine I just get a random web page rather than my 404.

    I mean if I go to http://domain/notaurl

    Do I need to write this into my htaccess like you would for a static site? Didn’t think I’d need to do that. It may well work on a live server not tested but how can I get working locally?

    Cheers

    # June 24, 2013 at 9:32 pm

    Go to Settings > Permalinks and hit ‘Save’ just to make WordPress recreate its setting in the .htaccess, something might have gone wrong with it.

    Did you name your file `404.php`? That’s the only way WordPress will know to use that page.

    # June 25, 2013 at 3:33 am

    Thanks ill try that, yes I did name 404.php

    # June 25, 2013 at 1:01 pm

    Tried that Doc and it doesn’t seem to work. Any other ideas?

    # June 25, 2013 at 1:19 pm

    Is the rest of the site permalinks working? For example, if you go http://domain/some-link, does that work?

    # June 25, 2013 at 2:01 pm

    Sometimes, WordPress goes to a page that almost has the same URL. I’m not 100% sure why, I’ve seen it happen with my own sites, and it’s possible it did that because the page was renamed or something. For example, http://domain/some-link would exist, but if you’d go to http://domain/somelink it would go to the same page.

    Maybe that’s what’s happening?

    What do you mean with “I just get a random web page rather than my 404, is it really random? It changes when you refresh? Does it change the URL into the page you’re viewing/

    # June 25, 2013 at 4:12 pm

    Yes all other links are working fine. I have a local domain set up under http://mff-theme so when I visit say http://mff-theme/blog works no problem.

    But when I enter http://mff-theme/aaa for example the URL switches to https://mff-theme/aaa (https) and this part of the URL mff-theme/about-us/aaa gets entered as a Google search and google throws results as if I’m trying to run a search.

    Hope that makes sense.

    Any ideas?

    # June 25, 2013 at 4:19 pm

    You most likely didn’t set up your virtual host correctly. Issue is with apache not wordpress.

    # June 25, 2013 at 4:46 pm

    I thought that might be the case. Everything else works fine, any ideas of where to look? Just set up as I do all my other hosts.

    # June 25, 2013 at 5:58 pm

    What version of a local server are you running?

    L / W / M / XX Amp?

    The vhost config should be in your apache directory under:

    XAMP-install/apache-version/conf/extra/

    Or something simlar, that’s where it is in my WAMP installation.

    # June 25, 2013 at 7:49 pm

    Im using mamp pro, I know where the conf file is just don’t know what to change.

    # June 26, 2013 at 5:06 am

    Just tried using the default permalinks and it still does the same. Also tried on a different WP install with default theme and still does the same so its obviously nothing to do with WP and all to do with my local machine set up with MAMP.

    Anyone know what I need to change in my local set up?

    # June 26, 2013 at 1:40 pm

    Make sure mod_rewrite is working properly. Might have to look at your httpd.conf.

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".