I recently implemented a 404 page on our website in our development environment. We are running Expression Engine 1.6.8; I know, old, but I have no resources to upgrade.
We use URL parameters (Query Strings for UTM parameters and the like) on various areas of our website for tracking purposes. What we are noticing is that some of them are now showing the 404 page when accessed, now that the 404 functionality is in place. I did not notice it previously because 404s directed to the homepage, but I guess they technically 404ed then too.
For instance, this causes a 404 (I replaced our domain with ourwebsite.com for confidentiality purposes:
http://www.ournewdomain.com?mkt_tok=3RkMMJWWfF9wsRonu67OZKXonjHpfsX57u0pWaC1lMI/0ER3fOvrPUfGjI4AT8NiI+SLDwEYGJlv6SgFTrHFMbhhzLgFXhE=
(what happens in this case is a “/” is added after the .com and before the ?. So I think EE thinks this is a subpage.)
http://www.ournewdomain.com/?mkt_tok=3RkMMJWWfF9wsRonu67OZKXonjHpfsX57u0pWaC1lMI/0ER3fOvrPUfGjI4AT8NiI+SLDwEYGJlv6SgFTrHFMbhhzLgFXhE=
This does not 404:
Has anyone encountered this in the older versions of EE who can provide some insight regarding how we can fix this? This is urgent as we really want to have a 404 page live for SEO purposes. But obviously we don’t want valid pages with parameters to result in the 404 page showing.
Here is what our htaccess looks like. Note we went through a rebrand and added redirects from our old domain to new domain.
SetEnv APPLICATION_ENV production
RewriteEngine On
RewriteCond %{HTTP_HOST} ^ourolddomain.com [NC]
RewriteRule ^(.*)$ http://www.ournewdomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^ournewdomain.com [NC]
RewriteRule ^(.*)$ http://www.ournewdomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.ourolddomain.com [NC]
RewriteRule ^(.*)$ http://www.ournewdomain.com/$1 [L,R=301]
RewriteRule ^img[0-9]+/(.*)$ img/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Also, it’s worth noting that I’ve tried, in our index.php file, changing $qtype from 0 to 1 (for path_info). The homepage no longer 404s, but none of my menu items work; they all direct to the homepage. Changing it from 0 to 2 for query_string doesn’t work; the homepage still 404s.