CodeIgniter Forums
Whenever I enter a url which isn't the default, I get redirected to dir above root - 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: Whenever I enter a url which isn't the default, I get redirected to dir above root (/showthread.php?tid=40534)

Pages: 1 2


Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]gunnarflax[/eluser]
[quote author="toopay" date="1302647181"]open your .htaccess file, and replace it ALL with this...
Code:
RewriteEngine On
RewriteBase /admin/

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 ^(.*)$ admin/index.php?/$1 [L]
[/quote]

With this code I get an Internal Server Error (500) Tongue


Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]toopay[/eluser]
i post two configuration, use the second...


Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]gunnarflax[/eluser]
Tried the second and still get the Internal Server Error :/


Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]toopay[/eluser]
how about this....
Code:
RewriteEngine On
RewriteBase /admin/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /admin/index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /admin/index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /admin/index.php?/$1 [L]



Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]gunnarflax[/eluser]
Now it works as it should Smile thank you all very much for the help!


Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]toopay[/eluser]
I found bunch similar thread from this forum : setting up a project under 'localhost' usually give you some trouble, one of them is what you face above.

Ussualy (again), you will face another problems while you deploy your project into cloud server, which you didn't expected when you develop in your local machine. One from many way solution is to set your developing environment as close as your live result. Read this thread may help you do that.


Whenever I enter a url which isn't the default, I get redirected to dir above root - El Forum - 04-12-2011

[eluser]gunnarflax[/eluser]
Thanks, I'll read that thread Smile