Url Rewriting in Codigniter - Is it possible?


I need to know that is there any tutorial that how to re-write URL's for the application developed in CODEIGNITER???

I searched google but did not find any results.

Here is what i need

my url: www.abc.com/index.php/client/moredest/
seo url: www.abc.com/more-destinations/

my url: www.abc.com/index.php/client/destinations/content/0/5
seo url: www.abc.com/legal-statement/

I need to know that can i change my controllers in all over the applicaiton or is there any way to do url rewriting via .htaccess

please help in this regard.


I have the same problem, I hope somebody help us!

Take a look at the [url="http://ellislab.com/codeigniter/user-guide/general/routing.html"]Routing[/url] page of the user guide.

Yes but, that, don't show how remove de subdir. I mean:




That can probably be done in your .htaccess

RewriteBase /
RewriteRule ^(.*)$ /my_application_folder/index.php/$1 [L]

I have that rule now and it doesn't work.

How the server now it must to navigate to /my_application_folder/ when the .htaccess is inside /my_application_folder/

You answered you own question, it can't.

Put the .htaccces in your root and do not modify the one in your application folder. That should do the trick.

create a .htaccess file and add the following lines in the file

Quote:RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{SERVER_PORT} !^443$

---You can use notepad to create .htaccess file.
--- keep this file at the location of codeigniter index.php(i.e. in the root folder)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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