• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to redirect from CI index.php to folder/index.php?

#11
[eluser]qwertyjjj[/eluser]
[quote author="porquero" date="1329408480"]Are you sure?

Read Tutorial - Static pages: Routing

http://ellislab.com/codeigniter/user-gui...pages.html[/quote]

So, I did this in routes:
$route['default_controller'] = "Contr_redirect";

I made a controller called Contr_redirect with:
<?php

class Contr_redirect extends Controller{
function index()
{
redirect('catalog/index.php', 'location');
}
}

?>

However, I get a 404 error when going to http://localhost

#12
[eluser]InsiteFX[/eluser]
It's CI_Controller not Controller!

#13
[eluser]qwertyjjj[/eluser]
[quote author="InsiteFX" date="1329433734"]It's CI_Controller not Controller!
[/quote]

I changed that but same problem, 404 not found error.

routes.php

$route['default_controller'] = "Contr_redirect";

Contr_redirect.php
<?php

class Contr_redirect extends CI_Controller{
function index()
{
redirect('catalog/index.php', 'location');
}
}

?>

http://localhost
404 Page Not Found

The page you requested was not found.

On a completely separate note, should I be doing this anyway?
AM I supposed to place the OSCommerce app into the applictaion folder entirely?


#14
[eluser]qwertyjjj[/eluser]
[quote author="qwertyjjj" date="1329434158"][quote author="InsiteFX" date="1329433734"]It's CI_Controller not Controller!
[/quote]

I changed that but same problem, 404 not found error.

routes.php

$route['default_controller'] = "Contr_redirect";

Contr_redirect.php
<?php

class Contr_redirect extends CI_Controller{
function index()
{
redirect('catalog/index.php', 'location');
}
}

?>

http://localhost
404 Page Not Found

The page you requested was not found.

On a completely separate note, should I be doing this anyway?
AM I supposed to place the OSCommerce app into the applictaion folder entirely?

[/quote]

Any ideas?

#15
[eluser]pbflash[/eluser]
Code:
redirect(‘catalog/index.php’, ‘location’);

This is going to try and redirect to a catalog controller in the application/controllers folder. Since it does not exist you will get a 404 error. Sounds like you want a redirect to the OSC catalog/index.php page which is outside of your CI install so I would use the PHP header function.

#16
[eluser]qwertyjjj[/eluser]
[quote author="pbflash" date="1329695351"]
Code:
redirect(‘catalog/index.php’, ‘location’);

This is going to try and redirect to a catalog controller in the application/controllers folder. Since it does not exist you will get a 404 error. Sounds like you want a redirect to the OSC catalog/index.php page which is outside of your CI install so I would use the PHP header function.[/quote]

But that's just putting in a normal PHP page as index.php isn't it?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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