Due to my hosting company's policies I am using pretty url in CakePHP (without the Apache mod rewrite). My homepage is at:
http://stthomasedu.org/index.php/home
How can I redirect traffic from
'http://stthomasedu.org/' to 'http://stthomasedu.org/index.php/home' ?
I've tried to edit index.php with
header("Location:http://stthomasedu.org/index.php/home");
but it's not working, every time I have to manually enter the URL "http://stthomasedu.org/index.php/home"
Any ideas?
SOLVED : IN C-PANEL I HAVE AN OPTION TO REDIRECT ALL MY TRAFFIC TO (http://stthomasedu.org) ANY LOCATION (now i set it to http://stthomasedu.org/index.php/home)
Did you remember to exit after your header() call?
header('Location: /index.php/home');
exit;
Since you are using Apache, you can add these lines in a .htaccess
:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^$
RewriteCond %{HTTP_HOST} ^stthomasedu.org$
RewriteRule ^$ http://stthomasedu.org/index.php/home [L,R=301]