• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Put CI website in the subfolder

#1
[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

#2
[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

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

#4
[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]

#5
[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...

#6
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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