I have a site created using CodeIgniter, and the application is installed on the web root (/). This is a shared hosting environment on GoDaddy. For creating a Development environment, I copied the same and created a /development folder in the / root.
Now, my main site works well, but when I try to use any link on the sub-directory (linked to a different domain name), it is always giving me a 404 error.
I have tried the solution given on Stackoverflow, but it does not work.
Duplicate of: CodeIgniter won't run in a subdirectory
So my structure is:
/system
/application1
/index.php
/.htaccess
/development/application2
/development/index.php
/development/.htaccess
The top level .htaccess contains:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
The sub-directory .htaccess is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /development/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
(I have even tried the suggestions given on StackOverflow to add a ./ in front of the INDEX.PHP files, and the suggestions provided in the other ticket)
The $system_path in the sub-directory points to the top level /system folder, so as to avoid any conflicts.
The main page displays correctly on the site, & even the main page of the sub-domain, created as:
http://www.mysite.co/
http://development.mysite.co/
But any links from the sub-domain created show the 404 error and I have not been able to get any of the links working.
I am hosting on a shared server (Linux) on GoDaddy and have PHP 5.3 installed. The main root is at a location (absolute path): /home/content/22/88885555/html
And the sub-directory I have created is at (absolute path): /home/content/22/88885555/html/development
I have used the paths as:
/
/development/
Does anyone have knowledge of or has experimented with such a setup?