Welcome Guest, Not a member yet? Register   Sign In
Problems in setting up the home page
#1

[eluser]Geek[/eluser]
I'm a professional web developer but I'm pretty new to PHP and CodeIgniter. I'm stuck with a weird problem and I'm trying to figure out a solution.

I've setup the first page of my application successfully (http://www.subayogam.com/home) using the codeigniter framework. However, I want my users to access my site without the /home i.e. http://www.subayogam.com. But since I'm using mod_rewrite to include index.php in every request, accessing http://www.subayogam.com throws an error. My default controller is "pages" and the method "view" is called for all requests with the page parameter set to the next URI segment. In other words, http://www.subayogam.com/index.php/pages/view/home is the complete internal path of http://www.subayogam.com/home and the method call will be view('home'). However, when I try accessing http://www.subayogam.com, the page parameter is empty and the method is being called as view() which ends up in a 404 error.

I also tried setting up an index.html page that redirects to the required url with the directoryindex index.html index.php, adding index.html to the exclusion list in my htaccess file. But it doesn't seem to work (I'm able to access index.html if I specifically mention it as http://www.subayogam.com/index.html).

How can I automatically redirect all calls to http://www.subayogam.com to http://www.subayogam.com/home? Please advise.




Theme © iAndrew 2016 - Forum software by © MyBB