We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

URL loading pages instead of 404

Development and Programming

Galactus's avatar
Galactus
2 posts
11 years ago
Galactus's avatar Galactus

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>

       
USC Chan's avatar
USC Chan
81 posts
11 years ago
USC Chan's avatar USC Chan

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.

       
Boyink!'s avatar
Boyink!
5,011 posts
11 years ago
Boyink!'s avatar Boyink!

As Paul indicates - complete 404 management in EE requires more than just a simple configuration or HTACCESS setting.

Here’s a good primer: http://joviawebstudio.com/index_ee.php/blog/guide_to_404_pages_with_expressionengine/

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.