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.

Moving expression engine index.php from root into folder

November 14, 2010 8:44am

Subscribe [3]
  • #1 / Nov 14, 2010 8:44am

    ollym

    17 posts

    Hello all

    I wonder if you can advise on moving around of some EE and WP files on my server. I want to make my EE site an archive, and the WP installation the main website.

    I currently have two CMSs installed. The first is an Expression Engine installation in the root directory:
    - http://www.teentoday.co.uk/
    - Admin files in a folder called /[namehere]/

    The second is a wordpress installation at:
    - http://www.teentoday.co.uk/news
    - With all files within the /news/ folder


    I moved my EE files:
    index.php
    .htaccess
    license.txt
    path.php

    to the archive folder http://www.teentoday.co.uk/teentoday/

    I moved my WP index.php and .htaccess to the root directory and have successfully installed it there after making a few tweaks in the control panel.

    Now however when I go to http://www.teentoday.co.uk/teentoday/ to see the archived EE site I get:

    “The system path does not appear to be set correctly. Please open your path.php file and correct the path.”

    Can anyone advice of the file changes I need to make to the paths to make this work.

    Thanks

  • #2 / Nov 15, 2010 2:28am

    John Henry Donovan

    12339 posts

    ollym,

    Open up your http://www.teentoday.co.uk/teentoday/path.php and change

    $system_path = "./system/";

    to

    $system_path = "../system/";

    So it is pointing to your system folder outside of the teentoday folder.

    Does that help?

  • #3 / Nov 15, 2010 5:50am

    ollym

    17 posts

    Hi John - thank you for this. This now ‘works’. The only issue I now have is all my article URLs have updated. For example:

    http://www.teentoday.co.uk/article/golden-circle-tickets-t4-stars-of-2010/

    is now:

    http://www.teentoday.co.uk/teentoday/article/golden-circle-tickets-t4-stars-of-2010/

    Which then doesn’t work? Any ideas… is this to do with URLs being rewritten? Thanks again.

    PS you can see the site at http://www.teentoday.co.uk/teentoday/

  • #4 / Nov 15, 2010 3:56pm

    Ingmar

    29245 posts

    How are you links created? Can you show us a bit of relevant code?

  • #5 / Nov 15, 2010 4:39pm

    ollym

    17 posts

    Hi

    There’s a rewrite on the links as follows (.htaccess):

    AcceptPathInfo On
    RewriteEngine On
    #Forum
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^forums/(.*)$ /index.php/forums/$1 [L]
    #Members
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^member/(.*)$ /index.php/member/$1 [L]
    #Handle comment redirection
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^teentoday/?(.*)$ /$1 [R=301,L]
    #Handle removal of index.php and template group from EE URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/teentoday/$1 [L]
    
    #Specific URL redirects
    redirect 301 /calendar/ <a href="http://www.teentoday.co.uk/page/teen-events/">http://www.teentoday.co.uk/page/teen-events/</a>
    redirect 301 /article/redirect <a href="http://www.teentoday.co.uk/news/?=hp">http://www.teentoday.co.uk/news/?=hp</a>
    redirect 301 /calendar <a href="http://www.teentoday.co.uk/page/teen-events/">http://www.teentoday.co.uk/page/teen-events/</a>

     

    I didn’t create this and it is meaningless to me, but believe it’s what’s creating the URL structure.

    Thanks again

  • #6 / Nov 15, 2010 4:45pm

    ollym

    17 posts

    Oh and to clarify, I believe I have a custom field for the creation of the article URL (golden-circle-xxxxx) for SEO.

  • #7 / Nov 16, 2010 4:44am

    John Henry Donovan

    12339 posts

    ollym,

    Because you moved your site into the folder ‘teentoday’ it is now part of your URL structure.

    http://www.teentoday.co.uk/teentoday/article/golden-circle-tickets-t4-stars-of-2010/

    In your htaccess there is a method for the removal of index.php from the URL which unfortunately we do not support.

    You can see how the correctly formatted URL works
    http://www.teentoday.co.uk/teentoday/index.php/article/golden-circle-tickets-t4-stars-of-2010/

    My advice is to update the rule which handles the removal of index.php and template group from EE URLs to just index.php and not include the teentoday segment.

    Then you can apply a rule to remove the teentoday segment when somebody accesses it

    RewriteRule ^teentoday/(.+)$ <a href="http://www.teentoday.co.uk/$1">http://www.teentoday.co.uk/$1</a> [R=301,L]

    None of this is considered official support though so moving this thread to the CodeShare Corner for you

  • #8 / Nov 18, 2010 9:51am

    ollym

    17 posts

    Hi John

    Thanks for your advice on this.

    I saw this:

    My advice is to update the rule which handles the removal of index.php and template group from EE URLs to just index.php and not include the teentoday segment.

    Then you can apply a rule to remove the teentoday segment when somebody accesses it
    RewriteRule ^teentoday/(.+)$ http://www.teentoday.co.uk/$1 [R=301,L]

    Can you clarify the exact changes I need to make as I have not worked with URL rewrites before?
    If you can’t help with this, should I perhaps post for paid development?

    Thanks
    Olly

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

ExpressionEngine News!

#eecms, #events, #releases