CodeIgniter Forums

Full Version: Problem redirecting to an html page outside my application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Jay Turley[/eluser]
In my root, there are two files:

index.html // the site index page
application.php // the CI controller for dynamic portion of site

After performing certain tasks, I wish to redirect to index.html

Obviously, using

Code:
$this->load->helper('url');
redirect('index.html');

would be a FAIL.

Not being very familiar with PHP yet, I tried

Code:
http_redirect('/index.html');

This did not work.

Can anyone out there point me toward the proper way to do this?

Thanks a ton!

El Forum

[eluser]Sumon[/eluser]
Javascript redirection might be useful one. Give it a try:
Code:
echo '[removed][removed]="http://www.your-site.com/index.html";[removed]';

El Forum

[eluser]Jay Turley[/eluser]
[quote author="Sumon" date="1221642581"]Javascript redirection might be useful one. Give it a try:
Code:
echo '[removed][removed]="http://www.your-site.com/index.html";[removed]';
[/quote]

I *hate* when it removes code... are you suggesting something like

[script]
document.location.href = "url";
[/script]


( pretend the [ are < )

El Forum

[eluser]Sumon[/eluser]
Exactly.
Sorry for my messy code. actually this is my first post of JS.

El Forum

[eluser]Jay Turley[/eluser]
Okay, thank you for the suggestion. I may do that, but I was hoping there was some solution out there involving PHP so I don't have to depend on JS support in the client browser.

Thanks!

El Forum

[eluser]Dr.Dan[/eluser]
Why not try header('Location: http://www.example.com/index.html');

El Forum

[eluser]Weblizard[/eluser]
How about this?
Code:
redirect('index', 'location');
Note: Just remove .html extension from your first post and you'll be fine

El Forum

[eluser]Jay Turley[/eluser]
[quote author="Dr.Dan" date="1221650237"]Why not try header('Location: http://www.example.com/index.html');[/quote]

And it's Dr. Dan FTW!!

Beautiful. And thank you very much! :-)