Help with Joe's SEO helper stack

Hi Folks,
I’ve added @joeworkman SEO helper to my site, having watched the long SEO tactics video and meta tags video, both which were super helpful. However, even though I’ve made an ‘error 404 page’ and altered my htaccess file as directed, it’s not working for me. If I enter a garbled address I do get redirected to the right page, but it just fires up a ‘page not working’ error? If I drag the index.php file for the page on to chrome it looks fine… Any ideas why this could be? The page should show up here:

https://kentlogs.co.uk/not-found/

Also, I’ve noticed that if I run the site through web.dev I get the following SEO error: I must be doing something wrong with SEO helper?? I don’t seem to even have a robots.txt file…. eek! (Nice SEO score though! Thanks Joe!)

Anyone know what might be causing these errors…

Thanks

I’m on my iPad but when I click on the link I get a blank page.
If I enter a non existing page like
https://kentlogs.co.uk/not-
I get redirected to the blank page https://kentlogs.co.uk/not-found/.

Hi @teefers Doug, thanks for looking… Here’s what that page looks like when I preview in RW:

and here’s the stacks view:

and here’s the .htaccess file I’ve edited, although we know the redirect is working…

It’s weird as it all seems to be correct but it just isn’t happy!

Cheers

what is the actual file name for the 404 page?

The file is index.php which is in the ‘not-found’ folder

I’m still away from the office, so on my iPad but I would maybe try republish all files. This:
https://kentlogs.co.uk/not-found/index.php
Still shows a blank page.

I would look on the server in that folder and see if there is a error.log file. The blank page and 500 error message is usually caused by a php error on the page.

ok thanks Scott. The file is deffo there on the server and if I ‘edit in transmit’ from transmit ftp client then all the code is there. Not blank. I probably shouldn’t screenshot it in case some of it is Joe’s proprietary code but no question about it being there… I’ll see what the error log says

Hmmm. No error logs in there.

The site is hosted on Dreamhost and seems to be running php 7.3

The error log would be in a directory called /logs in your root directory.

Thanks Doug… Found 'em! :

Not sure what they mean though… a cache error??

If someone else doesn’t help you out, I’ll should be back in the office in about an hour or so and will have a look.

Great. Many thanks Doug. There’s no rush as hopefully that page won’t be reached anyway but I’m hoping that solving this problem may point to a solution to the ‘robots.txt’ problem, which I’m more worried about for SEO reasons.

I’ll be finishing in about an hour but will be back in tomorrow morning.

Cheers

Put the full url for the 404 page in htaccess, ie add the index.php/index.html

Sorry Paul… Didn’t work. I’ll leave it like that though as it makes sense.

Okay,
Now I’m looking at the log message. I see that you are getting several Invalid URI Request.

The URL’s looks like they are "semi absolute since they start with /. That should mean that they would be “relative to the root”. But from the message text in the screenshot, the files are being requested all start with a /../. The .. says to “go up one level” so they are trying to access a directory outside the server root.

Now because of the 500 error, I can’t view the sources code. but I would like to know if the code itself contains the /../.

So an example of a jquery library statement that RW generates should look like this:

src='../rw_common/plugins/stacks/jquery-2.2.4.min.js?rwcache=584906451'

Does your (In the Source code) look like that or does it have the extra / at the start?

src='/../rw_common/plugins/stacks/jquery-2.2.4.min.js?rwcache=584906451'

Hi Doug,

So… the index.php file has the url ‘…/rw’ etc (that extra dot is being put in by the forum! it should show two dots then forward slash)

but. the directory structure on dreamhost is unusual in that the root is not where the site files are as they are in a folder within that:


08

My other sites on other servers normally connect straight to the location of the site files but then that could be how Dreamhost works (I didn’t set up the original account). And, the site is working so I guess its correct to be like that.
in RW I have the setting on the ‘advanced’ page set to ‘Relative to page’. Is that correct?

Thanks
Roger

I’m not sure why you are getting the error then.
I have a simular setup on DeamHost and just ran a quick test. I set up an ht access file entry:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
DirectoryIndex index.php index.html index.cgi
# Disable directory browsing 
Options -Indexes
ErrorDocument 404 /not-found/

I have a RW page setup with the folder name not-found, (it is an html file not php) and it works fine.

Is there a reason for you using PHP on a 404 error page? Since I can’t see the source for the PHP it would be just a guess on my part. I would start by placing the most simple HTML page out without much of anything on it.

Perhaps having an HTML file instead of PHP you might be able to see something more show up.

He is using my SEO Helper stack to help his generate a proper 404 page. The setup that he has in the htaccess for the 404 is correct.

The reason that this is not working is that your server is running PHP5.6. You need to update too PHP7.2+

2 Likes

Thanks @joeworkman, that worked! I was certain the server was running 7.3! Turns out I’d only upgraded one of my other DreamHost sites instead of all of them! What a numpty!

Sorry to waste your time @teefers Doug… I saw the php folder in the DH server root and it has a 7.3 folder inside that, which made me think I was right about the php version… Just shows me however much I learn about this malarkey, theres still tons of stuff I don’t know!

Thanks for the help. Much appreciated

1 Like