Moving a site to a subdirectory |
[eluser]sekiuchan[/eluser]
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 Code: <IfModule mod_rewrite.c>
[eluser]InsiteFX[/eluser]
You need to set the system and application folder paths in the index.php file also.
[eluser]sekiuchan[/eluser]
My folder structure is like this (I didn't make it this way, taking over for another dev)... /dev /application /controllers /models /views ..etc /system /application /controllers /models /views ..etc index.php 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?
[eluser]InsiteFX[/eluser]
Change the base_url in the dev application/config/config.php
[eluser]sekiuchan[/eluser]
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.
[eluser]sekiuchan[/eluser]
Going to try dropping it in the root of another domain to see if that works.
[eluser]Aken[/eluser]
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. |
Welcome Guest, Not a member yet? Register Sign In |