Welcome Guest, Not a member yet? Register   Sign In
Url Rewriting in Codigniter - Is it possible?
#1

[eluser]eshban[/eluser]
Hi,

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.

Eshban
#2

[eluser]jparent[/eluser]
I have the same problem, I hope somebody help us!
#3

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

[eluser]jparent[/eluser]
Yes but, that, don't show how remove de subdir. I mean:

www.example.com/my_application_folder/class/controller

to

www.example.com/class/controller
#5

[eluser]rogierb[/eluser]
That can probably be done in your .htaccess

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

[eluser]jparent[/eluser]
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/
#7

[eluser]rogierb[/eluser]
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.
#8

[eluser]khagendra[/eluser]
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)




Theme © iAndrew 2016 - Forum software by © MyBB