For some reason we seem to be seeing lots of 404 errors with all requested URLs going to a valid link but with a trailing /null. I don’t know where this is coming from as it’s not in the front end code.
For example: http://domain.com/valid/valid/null
Since I can’t find the source of these trailing nulls I’d like to remove them with htaccess but I’m not having much luck:
RewriteRule ^([^/null]*)/null$ http://www.domain.com/$1 [NC,R=301]
My .htaccess knowledge is a little rusty. Could anyone point me in the right direction?
It is best to discover the source of the error as mentioned above.
If you need a respite while looking for it, the rules below, placed in .htaccess file in the root directory of your site, should strip out a trailing
/null