CodeIgniter Forums
Put CI website in the subfolder - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Put CI website in the subfolder (/showthread.php?tid=56094)



Put CI website in the subfolder - El Forum - 11-26-2012

[eluser]jacobson[/eluser]
Hello I have a problem with my CI project. I have a website on wordpress in my public_html folder and I have a folder "ci" with my codeigniter project. I changed the site_url in config to http://mysite.com/ci/, I deleted index.php. and added the .htaccess file

Code:
RewriteEngine on
RewriteBase /ci/
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php/$0 [PT]
options -indexes

When I want to enter http://mysite.com/ci it shows 404 error did I miss something ? I'd appreciate your help Smile


Put CI website in the subfolder - El Forum - 11-26-2012

[eluser]PhilTem[/eluser]
You deleted the index.php file? If you did so it's no surprise that nothing's working anymore. Put the index.php file back in since it handles all the requests and is the "gate" to your app Wink


Put CI website in the subfolder - El Forum - 11-26-2012

[eluser]jacobson[/eluser]
I didnt delete index.php permanently - just from the config file . Sorry My bad Tongue


Put CI website in the subfolder - El Forum - 11-26-2012

[eluser]PhilTem[/eluser]
Oh I see.

So, either it's the RewriteRule that screws it thus try
Code:
RewriteRule .* index.php/$1 [PT]

or it's the options to the RewriteRule, thus try
Code:
RewriteRule .* index.php/$1 [L]

My .htaccess that works perfectly on multiple pages for months
Code:
RewriteEngine On
RewriteBase /subfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]



Put CI website in the subfolder - El Forum - 11-26-2012

[eluser]jacobson[/eluser]
I changed my htacces to yours and still 404 error. Is it possible that htaccess file in my public_html (root) folder mess up ? I created a folder on my localhost and put my project inside and it worked just fine...


Put CI website in the subfolder - El Forum - 11-26-2012

[eluser]PhilTem[/eluser]
It could be that your deployment server has different settings on .htaccess such as it does not allow custom .htaccess files or whatsoever. Maybe you want to ask your sysadmin.