CodeIgniter Forums
redirect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: redirect (/showthread.php?tid=64119)



redirect - ofir - 01-16-2016

Hi all i install the codeigniter on subfolder .. like
www.site.com/subfolder
its load my the main controller good (its login page).
after i do the login good the redirect try now from the main domain and not from the subfolder..

what i need to change this is my htaccess file
Code:
<IfModule mod_rewrite.c>
# CodeIgniter Subfolder .Htaccess
# today hints by www.insanen.com
Options +FollowSymLinks

RewriteEngine On
# Please do-not forget to change RewriteBase /cms
RewriteBase /cms

RewriteRule ^$ /cms/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)

RewriteRule ^(.*)$ /cms/index.php?/$1 [L]
</IfModule>
after i try to login this redirect me to www.site.com/contrroler
and its need to be www.site.com/cms/contrroler

but the main page load good www.site.com/cms/


RE: redirect - skunkbad - 01-16-2016

(01-16-2016, 09:46 AM)ofir Wrote: Hi all  i install the codeigniter on subfolder .. like
www.site.com/subfolder
its load my the main controller good (its login page).
after i do the login good the redirect try now from the main domain and not from the subfolder..

what i need to change this is my htaccess file
Code:
<IfModule mod_rewrite.c>
# CodeIgniter Subfolder .Htaccess
# today hints by www.insanen.com
Options +FollowSymLinks

RewriteEngine On
# Please do-not forget to change RewriteBase /cms
RewriteBase /cms

RewriteRule ^$ /cms/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)

RewriteRule ^(.*)$ /cms/index.php?/$1 [L]
</IfModule>
after i try to login this redirect me to www.site.com/contrroler
and its need to be www.site.com/cms/contrroler

but the main page load good  www.site.com/cms/

Did you configure your base_url in config/config?


RE: redirect - ofir - 01-16-2016

yes i did it with the subfolder