How change admin login url in Codeigniter 1? - codeigniter

Im using codeigniter 1 for a web system I want to change admin login url to my custom login url
current url - *http://siteUrl/admin/login*
Want to change - *http://siteUrl/adlogin*
How can I change this using config/router.php
thanks.

make route in config/routes.php
$route['siteUrl/adlogin']='controllername/methodname';

You can create routes for Your New URL Like :
URL:
application_url/application/config/routes.php
$route['adlogin'] = 'admin/login;
Please try this solution for your problem.

Use That on Route Without parameter Pass
$route['adlogin'] = 'admin/login';
With parameter Use This..
$route['adlogin/(:any)'] = 'admin/login/$1';

Related

Laravel URL Helper return IP address instead of Domain name

I have a problem when trying to create the Url using URL helper. I'm using Laravel 6.
$verify_url = url("/verify");
This is return the URL with the IP address instead of the domain name.
I don't know if it is a problem with the Apache server or the code.
Please help me. Thanks.
Adding this directive to Apache Virtual Host config seems to have fixed it: ProxyPreserveHost On
But a better way to use your urls is to name them in your routes/web.php. For ex:
Route::post('/verify', 'HomeController#verify')->name('verify');
and wherever you need to access to this url just use like this:
$verify_url = route('verify');

How the Url path from file path name to another name in laravel

Fins below the route code.
Route::get('clientlayout.main.index','InvoiceTicketController#show');
Route::get('clientlayout.main.mydomains','InvoiceTicketController#set');
When I run these routes I'm getting the url as
http://localhost:8000/clientlayout.main.index and
http://localhost:8000/clientlayout.main.mydomains.
I want my Url to be changed as follows: http://localhost:8000/index and http://localhost:8000/mydomains.
Suggest me a solution for changing the route to rectify this issue.
Route::get('/index','InvoiceTicketController#show');
Route::get('/mydomains','InvoiceTicketController#set');
for named routes you can use like this way
Route::get('/index','InvoiceTicketController#show')->name('clientlayout.main.index');
for more details follow
https://laravel.com/docs/5.6/routing#named-routes
You should try the route.
Route::get('/clientlayout/main/index','InvoiceTicketController#show');
Route::get('/clientlayout/main/mydomains','InvoiceTicketController#set');
Url is making
http://localhost:8000/clientlayout/main/index
http://localhost:8000/clientlayout/main/mydomains
Or You Should try
Route::get('/index','InvoiceTicketController#show');
Route::get('/mydomains','InvoiceTicketController#set');
Then Url is making
http://localhost:8000/index
http://localhost:8000/mydomains

Codeigniter Issue route issue

I want the following to happen
The url something.com/why-us to go to content controller
The url something.com/nepal to go to location controller
How to manage the above in CI routes
Apply the below coding in routes.php in config folder
$route['why-us'] = "content_controller";
$route['nepal'] = "location_controller";
use your desire controller

codeigniter baseurl not working

I am using the baseurl() in my application. ex: "http://www.edocapp.in"
This is working in case if we type domain name with "www" but not working if I use "only http".
Application is hosted on server.
try
$config['base_url'] = 'http://www.edocapp.in';
this
Base URL should have / in the last char:
$config['base_url'] = 'http://www.edocapp.in/';
anyway, you should check your DNS record in your server/hosting.
Does it have an alias (CNAME Records) to redirect www.edocapp.in to edocapp.in ?

Override uri_protocol on specific controller in Codeigniter

I need to override the uri_protocol which is in config file for some controllers in CodeIgniter. I need to change it to "PATH_INFO" since i am using Oauth 2.0,the authorization code is returned via query string.
Thanks in Advance!
I got the Query string worked by adding the line to the config file,
$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
$config['uri_protocol'] = "PATH_INFO";

Resources