• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to remove index.php from my URL

#1
[eluser]ranjeet_sangle[/eluser]
Hello friends..

I have currently developed a website completely in Codeigniter. The problem is whenever any webpage other than the homepage is displayed the URL of the webpage contains the index.php

e.g; htp://abc.com/ //Homepage
http://abc.com/index.php/gpr
http://abc.com/index.php/alex/page_view

Can anybody suggest how to remove index.php from URL.

I have not made any changes to the config file yet..

#2
[eluser]xoRiZ[/eluser]
[quote author="ranjeet_sangle" date="1270166490"]Hello friends..

I have currently developed a website completely in Codeigniter. The problem is whenever any webpage other than the homepage is displayed the URL of the webpage contains the index.php

e.g; htp://abc.com/ //Homepage
http://abc.com/index.php/gpr
http://abc.com/index.php/alex/page_view

Can anybody suggest how to remove index.php from URL.

I have not made any changes to the config file yet..[/quote]

http://ellislab.com/codeigniter/user-gui.../urls.html

Section: Removing the index.php file

You'll need the "AllowOverride" in apache from your host.


If you have complications, reply and will see if we can help.

#3
[eluser]ranjeet_sangle[/eluser]
Thanx for ur help..!!

Actually I am not allowed to create a .htacess file on my web server. So that this option cant be implemented.

Is there any another way for doing so??..

#4
[eluser]xoRiZ[/eluser]
[quote author="ranjeet_sangle" date="1270169918"]Thanx for ur help..!!

Actually I am not allowed to create a .htacess file on my web server. So that this option cant be implemented.

Is there any another way for doing so??..[/quote]

I'm fairly confident that the answer is no, however, someone here may have an alternative approach to accomplish something similar to what you're looking for.

#5
[eluser]adamp1[/eluser]
Why are you not allowed .htaccess file? If you don't have that then I don't think there is another way.

#6
[eluser]mrwilson1[/eluser]
Can this "AllowOverride" for apache be explained briefly so I can contact my host to do it? What exactly am i asking for?

Thanks

#7
[eluser]$ilovephp[/eluser]
hmm.., you might consider removing the .php extension.. lols

in your cofig file change the base_url to http://www.yourdomain.com/index/

so whenever you use base_url in the redirect function do not include the "index" anymore

example:
Code:
redirect(base_url()."homepage");
//gives you http://www.yourdomain.com/index/homepage

i opt to use this since i hate .htaccess

#8
[eluser]mrwilson1[/eluser]
I considered that but was having such a time removing it I didnt do it. Good point though.

I copied an .htaccess script Ben has put on here and added allowOveride All. That took the site offline so I removed it and everything worked.

Scary

Thanks, I appreciate your help Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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