• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving a site to a subdirectory

I have a site that I want clone to a /dev directory so I can work on it w/o effecting the live site... in the config/config.php file I have set base_url and site_url to www.mysite.com/dev and the links on the site all map correctly but when I click them I get a 404 error... obviously it isn't routing correctly.

Any ideas why? Here's my .htaccess

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

You need to set the system and application folder paths in the index.php file also.

My folder structure is like this (I didn't make it this way, taking over for another dev)...


If I edit that index.php file, outside of both of the directories, it will effect them both, right? So how do I tell it that if the url has the segment /dev in it to treat it as a directory and whatever is after /dev is the controller, using a route[]?

Can I do an if statement in index.php that checks for the url segment /dev and if it is there sets the system_path and application folder to /dev/system and /dev/application?

is there an index.php file in the dev directory?

Change the base_url in the dev application/config/config.php

Yes there is an index.php file in /dev and it points to /system and application as it should, relative to that file....

I changed the base_url and site_url values and they work, they point to www.mysite.com/dev but the pages won't load, 404 when you click the links.

Going to try dropping it in the root of another domain to see if that works.

Typically if you have multiple applications using the same System folder, you duplicate and rename the application folder AND index.php. Then you set up two rules in your .htaccess, one for the sub-app and one for the main one.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.