another CI in subdirectory? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: another CI in subdirectory? (/showthread.php?tid=30302) |
another CI in subdirectory? - El Forum - 05-10-2010 [eluser]JackMeUp[/eluser] Hello, I have a CI site set up to use urls like: - www.dn.com/ - www.dn.com/home - www.dn.com/about Now I want to add a working copy of the site under folder /testnew - www.dn.com/testnew/about , etc... This seems to be working for the home page only. Whenever I click a link, for example to www.dn.com/testnew/contact, it loads www.dn.com/contact instead. I don't understand why. Does the answer lie in .htaccess, or routes.php? And in which CI instance? Here is my .htaccess Code: RewriteEngine On Thanks for any tips. Jack. another CI in subdirectory? - El Forum - 05-10-2010 [eluser]überfuzz[/eluser] How are the links mustered? If you're planning to move the site around, say to a sub-folder, you could render your links like this. Code: <a href="<?php echo current_url(); ?>/this_is_here_in_this_subfolder_to">Link</a> May not work in all scenarios but I get the idea of flexibility. another CI in subdirectory? - El Forum - 05-10-2010 [eluser]danmontgomery[/eluser] You seem to be mixing and matching your .htaccess Code: RewriteCond %{REQUEST_FILENAME} !-f Will only route paths that do not exist Code: RewriteCond $1 !^(index\.php|images|robots\.txt|css) Will only route things not listed here... Since you're already not routing existing files & directories, this line will never do anything. Unless these files don't actually exist, in which case you'd just get an apache 404 instead of a CI 404. Since you have a separate installation in /testnew, you would need a new htaccess for /testnew, and you would need to change RewriteBase from / to /testnew/ another CI in subdirectory? - El Forum - 05-10-2010 [eluser]JackMeUp[/eluser] [quote author="noctrum" date="1273537640"]...you would need a new htaccess for /testnew, and you would need to change RewriteBase from / to /testnew/[/quote] Ding ding ding WINNARRR ! That seems to do the trick, thanks for your input guys! Jack. |