Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$80
.htaccess problems - 404
This is a deeply frustrating problem as I am going live on monday and I have so much more to finish over the weekend. Need help fast!
Yesterday, before roughly 20:30 GMT - my website was 100% working fine with the permalink structure set to /%postname%/ - pages were being found as normal.
At 20:30 GMT 16th Aug, I started getting 404 on all my pages.
This is like my 12 wordpress build, and I have had permalink problems in the past, and I simply fixed them with .htaccess permissions etc.
But this site was work fine in the first place, and I don't know why it started.
This time the 404 error is sporadic and makes absolutely no sense.
I have these post-types below...
Post
Page
Exhibitors
Zones
Features
Competitions
Please see below the 404 messages I get...
Post - single returns 404 - but archive pages work
Page - page returns 404 - but sub pages work
Exhibitors - works
Zones - works
Features - works
Competitions - works
How can this be????
My .htaccess contains this...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>... and is 100% writable and in the correct location. As you can see, half of my content works.
So I'm like WTF is going on!
So I basically got my server provider to run a database restore from 15th Aug - and bingo, my site is back to normal. All my pages work fine and I get no 404 messages.
I went into the permalink settings, and my website went straight back to 404 messages. And I didn't change any settings!
I again, got my server provider to run the same database restore, bingo back to normal! But in my admin, as soon as I hit the Settings > Permalink button, if screws the site up. And I havent even clicked any settings yet. It just does it.
I got my server provider just to restore the options_table in the database, and bingo - back to normal. But as soon as I hit the 'permalink' button, I get random 404 errors on pages.
So please see links below of the options_table if that helps. Before/After
This is my options_table which works
This is my options_table after I click the 'Permalink' button
-----------------
What I did next...
I tested other themes, the all do exactly the same. So it is not theme related.
I deactivated all plugins
I migrated the website to a fresh server. I installed brandnew wordpress core files and copied all my uploads, theme and plugins accross. Run database queries to change the server name, and it does exactly the same.
So it's nothing to do with themes or core files. Then what can it be?
Any help please, please don't take offense if I can't reply to everyone.
Money will go to working solution.
-----------------------------------------------------------------------
MY ORIGINAL QUESTION
Something is up with my site and I can't figure out what happened and I can't seem to get it back to how it was.
My .htaccess file, which is in the 'Site Address (URL)' folder location, is writable 777.
For some reason now I can't get the permalink structure /%postname%/ to work? - Post name
It was working fine, but for some reason all my pages including posts started showing my 404.php page.
But now when I update my permalink stucture, it says the .htaccess is not writable, when it is.
OK, so I copied the code into my .htaccess anyway and I still get 404 for all pages.
Can database have anything to do with this? My pages work fine if I go back to the default permalink structure, but I can't figure out why I just 404 for every thing.
My .htaccess looks like this..
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>But wordpress will not write this for me, I have to manually put this in.
But if I delete the .htaccess contents, and leave a blank file in place. Then I get my Apache server page cannot be found. Which theoretically means wordpress is using the .htaccess, but not doing what it is suppost to...
Aaaahhh
Has anyone experienced anything like this? Please help.
OK, things I was doing when this happen, which was either 2 things...
1. I installed a plugin: http://wordpress.org/extend/plugins/wordpress-meta-robots/
Once I noticed pages were showing 404 I deactivated it and still I was getting 404, so I cant see this being the issue.
2. I was working on duplicate test site on another server, which had my ftp credentials for broken site, in the functions.php...
define('FTP_USER', 'example_co_uk_2');
define('FTP_PASS', 'fyvTrfMpLUdR');
define('FTP_HOST', 'dev.example.co.uk');
define('FTP_SSL', false);Accidentally these ftp credentials above are for my broken site, not for my duplicate test site. So I deleted this when I spotted this, but I thought this would only affect plugin installations from 3rd party stuff??
But the duplicate test site database is completely separate, and is not connected my broken site - so anything that I may have changed on the duplicate test site surely couldnt affect my site?
And thats it... The site was working perfect before this.
This question has been answered.
Josh Cranwell | 08/16/12 at 7:59pm
Edit
Previous versions of this question:
08/16/12 at 8:04pm
| 08/17/12 at 11:10am
| 08/17/12 at 11:13am
| 08/17/12 at 11:23am
| 08/17/12 at 7:00pm
(6) Possible Answers Submitted...
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
08/16/12
8:14pmAbdelhadi Touil says:Hi.
I think it's a problem with .htaccess file permession, sometimes server dos not let us to change it, so after changin permession to 777, refresh your files via FTP and see if it's really 777.
I sugest to create a new .htaccess file (not just delete the current .htaccess content), create a blank new one, and make it 777, then resave your permalink structure via wordpress admin.
Hope this helps you. Sorry for my bad English.
Good luck.- 08/16/12 8:20pm
Josh Cranwell says:Thank you for the advice.
I did try this, I deleted .htaccess, made new ones. Tried a couple ftp clients like cyberduck and espresso. Refreshed permissions and definitely was changing (so it says)
I will contact my server guy tomorrow morning and see if he can see any problems with it. I never had this problem before and for it to just start. Very weird.
I'm off to bed but will pick this up in 7 hours.
Thanks
- 08/16/12 8:23pm
Abdelhadi Touil says:You are welcome. Good night.
- 08/16/12 8:20pm
-

Last edited:
08/17/12
12:48amArnav Joy says:try two things:-
1. Switch to twentyeleven or twentyten theme and then test it.
or
2. keep the full backup of your site including db then reinstall wp again and then install the plugins one by one and see.- 08/17/12 4:21am
Josh Cranwell says:Interesting....
Switch to my twentyeleven theme and the permalinks structure works?
How can this be related?? - 08/17/12 4:34am
Arnav Joy says:if this thing happening then there must be any code in your theme that is overriting default behaviour , check your theme for any rewrite rule , specially functions.php or share it here
- 08/17/12 5:38am
Josh Cranwell says:Hi
I just discovered that all my custom post types work fine???
It's just pages and post that get 404.
It is a bit suspect that this plugin below only works for posts and pages...
And when I installed this, all these problems started...
http://wordpress.org/extend/plugins/wordpress-meta-robots/
I can't run a restore database backup because there are other server backups qued.. - 08/17/12 5:49am
Arnav Joy says:try this plugin
http://wordpress.org/extend/plugins/wordpress-seo/ - 08/17/12 5:57am
Josh Cranwell says:Sure this won't fix my 404 will it?
- 08/17/12 5:59am
Arnav Joy says:i am not sure , i have not tested it .. sorry i should have say this before
- 08/17/12 6:24am
Josh Cranwell says:Are you around to PM you?
- 08/17/12 11:36am
Arnav Joy says:can you provide me access to your site?
- 08/17/12 4:21am
-

Last edited:
08/17/12
2:27amAsad Iqbal says:Which server you are running now? Apache or nGinex?
- 08/17/12 4:22am
Josh Cranwell says:Apache for sure..
- 08/17/12 4:36am
Asad Iqbal says:This may cause for apache configuration. Please ask your hosting provider.
- 08/17/12 4:22am
-

Last edited:
08/17/12
4:50amPali Madra says:I would suggest deleting the .htaccess file.
Create a new blank .htaccess file.
Upload it to the root of the server.
Change the permissions to 777.
Now re-save or change the permalink structure and then save it.
The website should be working fine now.- 08/17/12 5:05am
Josh Cranwell says:Nope... still working...
OK I've established this...
These are my General settings...
WordPress Address (URL)
http://dev.example.co.uk/wp
Site Address
http://dev.example.co.uk/
But wordpress is not writing the .htaccess in the 'Site Address' - it is writing one in the 'WordPress Address (URL)' location???
How can this be happening???
- 08/17/12 5:14am
Pali Madra says:Hello Josh
Please remember that
- The "Home" or WordPress address (URL) setting is the address you want people to type in their browser to reach your WordPress blog.
- The "Site URL" or site address setting is the address where your WordPress core files reside.
Is this correctly defined in your installation? Please confirm.
- 08/17/12 5:18am
Josh Cranwell says:Are you sure...
It is the opposite way round I thought?
See this screen shot - 08/17/12 5:25am
Pali Madra says:Please refer to the codex at http://codex.wordpress.org/Changing_The_Site_URL
- 08/17/12 5:38am
Josh Cranwell says:Yeah hard coding it made no difference.
- 08/17/12 5:05am
-

Last edited:
08/17/12
1:50pmej_emman says:Hello Josh,
Based on what you said.
"Switch to my twentyeleven theme and the permalinks structure works?"
This gives an idea that there is a conflict in the functions of your template.
I also think that http://wordpress.org/extend/plugins/wordpress-meta-robots/ , this plugin
nothing wrong with your website.
I suggest to paste the function codes. So that we can trace up where does it goes wrong.
Cheers,
Joseph- 08/17/12 7:04pm
Josh Cranwell says:Thanks for your comment, Arnav had a look and after indepth testing it was a dodgy register_taxonomy function.
- 08/17/12 7:04pm
-

Last edited:
08/17/12
5:56pmphilip says:OK, my guess is that this is a software upgrade related problem.
e.g. if your host has updated their version of PHP recently you could get exactly this sort of problem.
Although it sounds like it is .htaccess issue, the pattern (certain post types show) suggests not.
2 other things you could do:
1) disable all plugins and re-enable one by one
2) in wp-config.php set WP_DEBUG to 'true' and check the output. Those 'warnings' should be diagnostic.
Post them here or a live link to problem pages with debug on and someone here no doubt will be able to help.
BUT if - as you say Twenty Ten works - the previous contributor is probably right and there will be some deprecated PHP function in your theme that is messing it up, most likely lurking in functions.php.
The explanation of the sudden change being some software update by your host.
Hope that helps a bit.- 08/17/12 7:05pm
Josh Cranwell says:Thanks for your comment, Arnav had a look and after indepth testing it was a dodgy register_taxonomy function.
- 08/17/12 7:05pm
This question has expired.
Josh Cranwell, Martin Pham voted on this question.
Current status of this question: Completed
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
