ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Might be going mad but getting Uh-oh, something went wrong! Error Code: 404 for some reason.

November 05, 2014 10:53am

Subscribe [2]
  • #1 / Nov 05, 2014 10:53am

    Acknowledged74

    7 posts

    HI

    I’ve created template groups say distribution and populated the index.php file within as I’ve done many time before.

    For some reason why I try and visit the page I’m getting the 404 error, like the page doesn’t exist.

    To clarify the main index.php page that is with the *site template group load fine, its just the subsequent pages that return the error.

    Strangely .../index.php/privacy return some of the privacy page, but surely that’s completely topsey turvey.

    Any idea, I’m probably missing something obvious?

    Going crazy here.

  • #2 / Nov 05, 2014 11:56am

    Acknowledged74

    7 posts

    Are OK a problem is that the index.php is coming up before the folder i.e

    So I’ve created a template group site which has a file inside index.php but when I view rendered template it shows as

    .co.uk/index.php/site

    I swear this is the same setup I always do, what have I missed?

  • #3 / Nov 05, 2014 4:05pm

    USC Chan

    81 posts

    Don’t know if this will help, but:

    Note that the default template for any template group is the one called “index” (not “index.php”). So if, for example, you have a template group called “example”, and a template within that called “index”, you’d access that using:

      domain.com/index.php/example

    The above is true if you’re not using URL rewriting to get rid of “index.php” from URLs (using .htaccess or whatever). If you *are* rewriting the URL to get rid of index.php, the URL would look like:

      domain.com/example

    The part of your question that’s confusing is that you seem to be describing a template called “index.php”. Are you mixing up the main template for each group (“index”) with the index.php file in your main EE install?

  • #4 / Nov 05, 2014 4:27pm

    Acknowledged74

    7 posts

    OK the key is the url rewriting which I need to do, will look into that.

  • #5 / Nov 05, 2014 5:22pm

    Acknowledged74

    7 posts

    OK

    So I’ve created a .htaccess file and uploaded this to my server. This reads

    <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/*(.*) site/$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 ^(.*)$ site/index.php/$1 [L]
    </IfModule>

    where my home page is index inside a folder called site.

    I’ve also set ‘Name of your site’s index page’ to blank, but still getting 404 can’t find the page.

    If I look at just the main sub folder so URL/folder rather than URL/folder/site then the home page loads up fine.

    Can someone take 30 seconds to check the .htaccess please.

    Really appreciate the help, doing my head in a bit, got to have the site finished, so an all nighter, but need to sort this issue out.

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases