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.

A Question About Paths

October 28, 2010 11:49am

Subscribe [3]
  • #1 / Oct 28, 2010 11:49am

    marcamos

    57 posts

    Hey everybody, I’ve got a question about the feasibility of using a particular URL both by EE and by ‘normal’ methods outside of EE.

    Here’s my situation: a client’s website is being converted from static to powered by EE slowly over time. This means that some areas of the site will be built on top of EE before others.

    The very first section we’re working on lives in a location such as /main/category1/feature/index.php (names changed to protect the innocent), yet there are numerous other important areas & pages that live nearby (for example /main/category2/thing/ and /main/category3/otherthing/ and so on).

    In an attempt to not change the URLs, I’ve taken the following steps (though I’m not 1,000% sure they’re the best solution):

    1. Made a template group called “feature”
    2. Inside that template group, there’s a template called “single”
    3. I built a quick and temporary channel/custom-field combo to ensure I can post something in this template
    4. I then used the Pages module to set the URL for one particular entry to the exact URL first mentioned above: /main/category1/feature/

    What I first noticed was that when attempting to visit that URL, I was served the static version and it seemed like EE stayed out of the picture. “No problem,” I said to myself, “I’ll just remove that /feature/ directory.” It didn’t work … seemingly EE stayed out of the picture and Apache simply returned a 404 page.

    The only time EE wanted to jump in and do its job was when I temporarily removed the entire /main/ directory from the file-system. With /main/ removed, EE then served me the entry/template I was looking for (built from steps 1 - 4 above).

    [You probably know where I’m going with this now…] So, yeah, that entire /main/ directory can’t be removed because so many other important bits and pieces live in there. Eventually we’ll get the entire site on EE and then those important static bits and pieces can be deleted, but not any sooner.

    So, finally, my question: what’s a guy to do? Is there some way to have my cake and eat it too?

    Many thanks for any advice you may have!

  • #2 / Oct 28, 2010 3:28pm

    Roi Agneta

    352 posts

    As I understand it, you have a certain set of pages running under EE and another set that are legacy static pages.  You can do this as long as EE is installed in a different directory on your site - in effect you end up with two root directories, say ../ee and ../static (or just your site root).  In the EE Control Panel you can set the root directory - if it is set to your site root then every url will get processed by EE and if if appears malformed by EE, i.e. does not include a valid template group/template name, you will get a 401.

    So, the EE root should be set to some directory above your actual site root and all links within EE templates should be set as absolute, especially if any of them are pointing to your old static pages.

    Hope that answers your question!

    Roi

  • #3 / Oct 29, 2010 2:17am

    John Henry Donovan

    12339 posts

    Does Roi’s response help you bostonwebstudio?

    I am going to move this thread to the CodeShare Corner as more appropriate there.
    Did you want both static and EE site live at the same time or just somewhere to develop the EE site that can easily go live when the time comes?

  • #4 / Oct 29, 2010 11:15am

    marcamos

    57 posts

    Roi: Thank you for your advice. I’m not 1,000% certain I “get it” just yet, but it may take some time experimenting to fully grasp what you’ve suggested.

    Another bit of advice I received from a friend was to copy the root-level index.php file into the directory in question, change the value of $system_path, define which template group to use in $assign_to_config[‘template_group’] = ‘’;, and go from there. Admittedly, after trying this method first, I saw some progress, but it wasn’t wholly successful and I’m not entirely sure I’m using it properly anyhow.

    I’ll give your suggestion more thought and some actual experimentation shortly, and the client and I may even ponder not attempting to keep the static and dynamic living together at all.

    We’ll see! Thanks, again, for your advice so far.

  • #5 / Oct 29, 2010 5:58pm

    Roi Agneta

    352 posts

    Marc - considering your situation a bit more, I think you are asking for some real angst by trying to split your site pages between a traditional static site and an EE one.  Here is something to consider: create a new template group called, say, “static”, then bring over all of the old static pages into EE by doing a copy/paste of each page’s complete HTML into a new EE template within the “static” group. 

    Dealing with menus and links in the old pages might be an issue, especially if the links are relative, but that is all straightforward stuff versus trying to figure out how to move back and forth between static and EE!

    A bit tedious, perhaps, but it should work without a problem.

  • #6 / Oct 31, 2010 2:38pm

    marcamos

    57 posts

    Hello again Roi,

    Many thanks for this additional suggestion … we’re certainly going to review our options and see what feels best. We may tackle this an entirely different way knowing now just how complex and/or tedious it may be.

    Thanks again!

  • #7 / Oct 31, 2010 2:55pm

    Roi Agneta

    352 posts

    You are welcome, and good luck to you!

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

ExpressionEngine News!

#eecms, #events, #releases