How to remove index.php from URL |
[eluser]justjiten[/eluser]
I am new to CI and using the version 2.1.2, I am trying it in my local server, I want to remove the index.php from my url, currently it is coming like http://localhost/ci/index.php/welcome. I want this like http://localhost/ci/welcome. I am trying from last 2days but I am unable to get it correct. Please help me to set it right.
[eluser]justjiten[/eluser]
Thanx Aken for your quick reply, but I already tried these things, these are not working in my case. I am new to CI please help me. my .htaccess file is like below Code: RewriteBase /ci/
[eluser]InsiteFX[/eluser]
If you are running Windows it will show index.php the first time after that it will be removed.
[eluser]justjiten[/eluser]
Yes I am working on XAMPP in Windows. but the index.php is not removed at all. Code: http://localhost/ci/index.php/welcome working fine, but when I type Code: http://localhost/ci/welcome It is showing the error404 Object Not Found. I have set config.php like Code: $config['base_url'] = 'http://localhost/ci/'; autoload.php like Code: $autoload['libraries'] = array('database'); and routes.php like Code: $route['default_controller'] = "welcome"; My .htaccess file is like Code: RewriteBase /ci/ please help me to remove index.php from url, I am using CI version 2.1.2
[eluser]justjiten[/eluser]
It works for me, what I did is Ichange the location of the .htaccess file, earlier my file structure was Code: /ci after that I changed my file structure to Code: /ci I put the .htaccess file at the same place where index.php is present and my .htaccess file is like Code: RewriteEngine on Now it solves my problem. Thanx for your help.
[eluser]InsiteFX[/eluser]
You need to add this: Code: RewriteBase On
[eluser]justjiten[/eluser]
It works for me, what I did is Ichange the location of the .htaccess file, earlier my file structure was Code: /ci after that I changed my file structure to Code: /ci I put the .htaccess file at the same place where index.php is present and my .htaccess file is like Code: RewriteEngine on Now it solves my problem. Thanx for your help.[/quote][/code]
[eluser]Unknown[/eluser]
Hi Guys My .htaccess file looks something like this >>>>>>>>>> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] >> n still when I try to acess like http://localhost/CodeIgniter/welcome Its showing not found.. i have added the .htacess i root folder.. Can anyone help me in this regards.. |
Welcome Guest, Not a member yet? Register Sign In |