cancel
Showing results for 
Search instead for 
Did you mean: 

404 issue

hellsbells
Newbie
Posts: 6
Registered: ‎11-04-2010

404 issue

I have a problem with my site. I'm sure this wasn't happening a few weeks ago. I have a blog at http://www.larryni.me.uk/blog/ - when I access the URL directly I get a 404 and the address bar displays http://www.larryni.me.uk/~hellsbells/blog/. Same happens when I click on the Home link or the header. All other links seem to be working as expected.
I can get to my home page when I use Firefox's Uppity extension - say I'm on http://www.larryni.me.uk/blog/about/ and activate Uppity then it takes me up a step to the blog/index page.
I've upgraded WP, went through all the WP settings and changed the theme - to no avail. Is it possible that something else changed when Plusnet did the CGI upgrades? I did notice WP giving me quite a few errors shortly after CGI came back on, but all went back to normal then.
Also, are there any plans to restore ssh access? It was so much handier to use when doing upgrades.
9 REPLIES 9
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: 404 issue

The behaviour you are seeing is associated with the introduction in mid March of the new more secure PHP5-based CCGI server you referred to. There is a long thread in this forum (ccgi down) concerning this.
A cgi-platform-php-upgrade-faq gives useful information on the implications of the upgrade. The /~username feature you mentioned is associated with the suEXEC security model and this post on Page 2 of the long thread gives more information.
As far as reintroduction of ssh access is concerned I would think that is most unlikely.
David
hellsbells
Newbie
Posts: 6
Registered: ‎11-04-2010

Re: 404 issue

Thanks for the links.
I had a look in my .htaccess, but really have no idea what to change - it was created by WP initially:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php
</IfModule>

Could anyone point me in the right direction please?
hellsbells
Newbie
Posts: 6
Registered: ‎11-04-2010

Re: 404 issue

I've been trying to figure out the correct rewrite rule for the past couple of hours now, but no luck. I take it that's all that needs changing?
Is anyone here good with regular expressions?  Wink
hellsbells
Newbie
Posts: 6
Registered: ‎11-04-2010

Re: 404 issue

Bump.
I still haven't been able to sort this out. There's gotta be someone who can help me with this?
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: 404 issue

If I go to http://www.larryni.me.uk/blog/ (which has a slash on the end) the page displays (that seems different from what you said in your opening post). However the Home link on that page looks identical, but it isn't - no slash; on clicking the Home link it gets rewritten internally to http://www.larryni.me.uk/~hellsbells/blog/ and a 404 error results in this case.
Does using something like the following to solve the trailing slash problem help?
Quote from: Gabe
You'll notice that on the new ccgi platform, %{REQUEST_FILENAME} does contain the full file path and can be tested for file or directory status, so the trailing-slash problem would now be solved by:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]

That comes from Gabe's post I linked to earlier.
David
hellsbells
Newbie
Posts: 6
Registered: ‎11-04-2010

Re: 404 issue

Yes, with the trailing slash it works, without you get the 404.
I did try to change my .htaccess based on that snippet from Gabe's post, but I have no luck with it. I tried simply adding it to htaccess as is, replacing / with /blog/, and also rewriting the part that Wordpress added (see above) and simply cannot get rid of the 404 when the trailing slash is missing.
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: 404 issue

What happens if you replace the complete .htaccess with Gabe's version as it's written?
You need to retain RewriteEngine On, of course. I would try with each of
RewriteBase / and
RewriteBase /blog/
David
Gabe
Community Veteran
Posts: 767
Registered: ‎29-10-2008

Re: 404 issue

Hi HB,
If you still want to fix the trailing slash problem, try putting this
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php

in a .htaccess in your root folder and deactivate the .htaccess in your blog folder (by renaming it was.htaccess or similar).
Gabe
hellsbells
Newbie
Posts: 6
Registered: ‎11-04-2010

Re: 404 issue

Finally got around to try this out, was a bit busy with work. Thanks very much, Gabe, this seems to have sorted it Smiley
adie:quote