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.

URLs not working without the template group

July 25, 2007 3:06pm

Subscribe [0]
  • #1 / Jul 25, 2007 3:06pm

    Kellankade

    54 posts

    I just changed the directory my website is in. From http://www.domain.com/new/ to www.domain.com.

    Everything seems to be working fine, until I tried to access some of my URLs. My default template group is ‘site’.

    SO if I try to access http://www.mydomain.com/site/contact/ the page comes up just fine. If I try to access it just using http://www.domain.com/contact/ it takes me to the search page. Where can I fix this setting?

  • #2 / Jul 25, 2007 3:16pm

    Lisa Wess

    20502 posts

    You can’t leave off the template group like that, EE requires it… The way around that is to use the Pages module, but since you’re probably using an EE form which is most appropriate in a template, you’ll need the full URL.

  • #3 / Jul 25, 2007 3:30pm

    Kellankade

    54 posts

    Lisa,

    I don’t want to be difficult, but it was working fine before I moved everything up a directory. Since it is the default/main template group I have always been able to leave off the template group from the URL. For instance. If you go to http://www.domain.com/ Expression Engine assumes that you mean to use the default template group and displays the template at http://www.domain.com/default_group/index/ Otherwise your dommain would have an error, if you didn’t access the root without a template group.

  • #4 / Jul 25, 2007 3:34pm

    Lisa Wess

    20502 posts

    Daniel, you’re absolutely right - but there’s a checkbox when editing the template group to set the index as default, in order to overcome this.  If you don’t have that set for any template group and visit the root, you’ll get a blank page.

    In any case, EE uses segment_1 as the template group, and it relies on this. There are some situations where you can leave off the template group and it will assume the default (the one that’s checked as mentioned) but those are advanced uses and not really ones we can support.  We always recommend including the template group as it is extremely important to EE, including EE’s 404 system.

  • #5 / Jul 25, 2007 4:14pm

    Kellankade

    54 posts

    Maybe I should approach this from a different angle. I have a functioning site. It is installed in http://www.domain.com/new/. We decide it is time for the site to go live and we move the install to http://www.domain.com.

    I followed the directions in the Wiki for moving servers. This included making sure my path and config files are correct. Then I made the changes to the database outlined in the wiki article.

    Now when I go to any URL that is my my main URL I am getting 404 Errors. Nothing has changed in the templates. The URLs are being sent from EE the same way they were before. Just missing the /new.  Which is what should be happening, excluding the 404 Error

  • #6 / Jul 25, 2007 4:28pm

    Lisa Wess

    20502 posts

    Do you have a link to the site, so that we can see this?  You can PM it if you don’t want it public.

  • #7 / Jul 25, 2007 5:38pm

    Lisa Wess

    20502 posts

    Hi, Daniel, can you tell me what “clients” represents? Also, do you have 404s enabled on your Template Preferences? It’d also help to know the contents of your .htaccess file.

  • #8 / Jul 25, 2007 5:46pm

    Kellankade

    54 posts

    Hi, Daniel, can you tell me what “clients” represents? Also, do you have 404s enabled on your Template Preferences? It’d also help to know the contents of your .htaccess file.

    My .htaccess file contains the following

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    It might be important to note that when I started having this issue, I removed the htaccess file and instructed EE to start using index.php again. I did this as a test to see if the problem was with my .htaccess file. It did not correct the issue so I put everything back how it was.

    Yes the 404 feature is enabled, It is set to the search page. that is why the search template page. I have not got around to creating a custom 404 yet.

    The clients template pulls posts from the weblog resources for clients.

  • #9 / Jul 25, 2007 5:56pm

    Lisa Wess

    20502 posts

    Ok.  The 404 feature absolutely requires a *valid* template group - that is exactly what it looks for.  You do not have a template group “clients” so it is serving up your search page, as you specified.  You’ll note the response headers even serve up a 404 header (actually surprising with that particular method for removing index.php, but that’s another issue).

    I honestly do not know why it worked before - however with the setup you have now, it is working as one would expect and as the intended behavior.

    You have a few options:

    Create a “clients” template group and leave off the index, putting the information into segment_2 so that it assumes the index. This will effect your URL structure the least.

    Turn off 404s - I do not recommend this.

    Use the full URL: index.php/templategroup/templatename/

  • #10 / Jul 25, 2007 5:57pm

    Lisa Wess

    20502 posts

    As a note, you might review the docs on 404 for how the 404 setup works.

  • #11 / Jul 25, 2007 5:59pm

    Kellankade

    54 posts

    Thank you Lisa

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

ExpressionEngine News!

#eecms, #events, #releases