Hello all,
Hope someone could provide me some insight. We have an internal website.
when going to the website. if you type
www.domain.com/test1 > shows 404 error page of page not found < correct
but www.domain.com/page1/test1 www.domain.com/page1/test2
test1 & test2 pages do not exist. All pages load page1 while they should load 404 error page.
what configuration is incorrect?
is the .htaccess rewrite the redirect issue?
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
Note that EE only shows the 404 page if the template group doesn’t exist — that is, where the first segment of the URL is invalid.
For the case you’re dealing with, where other segments are invalid, and the page doesn’t exist, I use some code that looks like this:
{exp:channel:entries channel="whatever" limit="1" require_entry="yes"}
{title}
{content}
{if no_results}
{embed="missing-page"}
{/if}
{/exp:channel:entries}Here, require_entry=”yes” stops EE loading the default page for the template group, and then the {if no_results} test causes a common template to be loaded, which flags the error and gives some advice.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.