- This topic is empty.
June 24, 2013 at 9:20 pm #45814
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?
CheersJune 24, 2013 at 9:32 pm #140209
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 #140243
Thanks ill try that, yes I did name 404.phpJune 25, 2013 at 1:01 pm #140309
Tried that Doc and it doesn’t seem to work. Any other ideas?June 25, 2013 at 1:19 pm #140310
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 #140325SenffParticipant
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 #140343
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 #140378AlenParticipant
You most likely didn’t set up your virtual host correctly. Issue is with apache not wordpress.June 25, 2013 at 4:46 pm #140383
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 7:49 pm #140405
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 #140480
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 #140590
Make sure mod_rewrite is working properly. Might have to look at your httpd.conf.
- The forum ‘Other’ is closed to new topics and replies.