1

Trying to setup a sub-directory with a separate EE installation. All is well with the installation, I got a few templates and tpl groups setup.

Whenever I try and view the template (Template manager -> TPL Group -> view) I always get a 404.

For a better understanding here is my site: http://warpedcoders.com/ here is the subdomain: http://warpedcoders.com/charlie/ and here is the 404 http://warpedcoders.com/charlie/news/page_content

My .htaccess currently looks like so:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /charlie/
        # Removes index.php from ExpressionEngine URLs
        RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ $1 [L]
</IfModule>

Could anybody help me out?

  • 1
    where is the htaccess in the subdir or in the maindir? Also, your rewrite rule looks odd, could you try RewriteRule ^(.*)$ index.php/$1 [L] or with a questionmark before the $1. (and set site root in config and index.php) – GDmac Oct 4 '13 at 21:49
  • Sorry, the htaccess is in the subdir and unfortunately that didn't work). Another thing to note is that I have removed index.php from the url in the admin panel – DarkMantis Oct 4 '13 at 21:52
  • please take a look at the docs (linked above) no rewritebase and especially look at the exceptions part (subdirs etc.) – GDmac Oct 4 '13 at 23:06
  • Well that is where I started, it didn't work so I tried editing it but to no avail. I might move it to a subdomain and see if that works. – DarkMantis Oct 5 '13 at 8:47
3

It looks like your 404'd page works with index.php: http://warpedcoders.com/charlie/index.php/news/page_content

So, try this for your .htaccess rewrite:

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On

  ## Removes index.php
  RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  # RewriteRule ^(.*)$ /index.php?$1 [L]
  # IF YOU HAVE WEBSITE IN A SUB FOLDER: comment out above line, uncomment below line, & replace 'SUBFOLDERNAME'
  RewriteRule ^(.*)$ /charlie/index.php/$1 [L]
</IfModule>

And make sure your /expressionengine/config/config.php file has this for your Index File setting:

$config['index_page'] = "";
| improve this answer | |
  • I created a similar thread here but I thought I would see if you can assist me as well. The way the client has the server set up is causing my nav to break. I followed your instructions above and it isn't working for me. I went wrong somewhere. Can you assist? Thanks :/ – MelPax615 Nov 24 '14 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.