Welcome Guest, Not a member yet? Register   Sign In
Custom URL rewriting
#1

[eluser]shankar ganesh[/eluser]
How to rewrite url to custome url using .htaccess

eg.,

http://www.example.com/user/contact.php to be rewrite as

http://www.example.com/user/shankar

shankar is from database, if by default there is no user in the database the URL should be like

http://www.example.com/user/contact
#2

[eluser]Dennis Rasmussen[/eluser]
Just to be clear...

1) You got a file named contact.php in the uri place of a method, are you even using CodeIgniter?
2) If you want the method to be a parameter you can use the routes file to redirect to a method within the user controller.
3) If you are doing the above then simply make a clause in your user controller to see if the user exists otherwise redirect/show another view/do something else (in your case show a contact page?)
#3

[eluser]shankar ganesh[/eluser]
Thanks,I got another method by using htaccess.

I am developing in codeignitor only,
I controller folder i am having two folders named as User and admin, one for user and another for admin
i am having admin and user panel. I can able to access user panel by http://wwa.jumpwebservice.com/ARG/
and for admin panel http://wwa.jumpwebservice.com/ARG/index.php/admin/home

where admin is folder name and home is controller name and how to customize URL like

http://wwa.jumpwebservice.com/ARG/admin

and in router.php i initiliazed as $route['default_controller'] = "user/home"; where user is folder name and home is controller name




Theme © iAndrew 2016 - Forum software by © MyBB