0

Hi Dear Stackflow Community i am newbie in Codeignite coding so i hope you guys give me the time to fix this error thanks is advance :)

  1. So basically i followed a tutorial here and i disabled index.php from URL that problem was fixed but here is my .htaccess right now and i still have the problem of example.com/?home/signin or example.com/?browse/ Or /?admin/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
</IfModule>
AddType text/vtt .vtt

But the problem is i followed every single tutorial here in stackoverflow on disabling the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ show in my URL i want a clean url directly with no controller name or the ? mark in it i tried going to my routes.php to change things in it following tutorials but still same issue remains here is how my routes.php looks like right now

*/
$route['default_controller'] = 'Home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

Please help me i attempted every single solution but nothing yet, I want to disable the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ shows in my URL i want a clean url directly with no controller name or the ? mark my controllers are Home, Admin, Browse, General, Payment, Updater can you give examples with them exactly so i can try please to fix the problem according to my controllers

4
  • Please admin or anyone help me i am waiting on someones help and answer Commented Jul 15, 2021 at 23:08
  • Hi 'here' isn't linked, what is it exactly that is the problem (any error messages)? and why is the solution below not ok. I'm not familiar with codeigniter but you probably just want to redo the routes with your own names. To your own controller. It's just not clear here on the problem and what an answer would look like. Commented Jul 16, 2021 at 9:24
  • What are you trying to accomplish here? Where is the tutorial you followed? Commented Jul 16, 2021 at 9:49
  • I want to disable the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ show in my URL i want a clean url directly with no controller name or the ? mark my controllers are Home, Admin, Browse, General, Payment, Updater can you give examples with them exactly so i can try please to fix the problem according to my controllers Commented Jul 16, 2021 at 11:12

2 Answers 2

0

Modify your route file with this and my advice will be to read more about CodeIgniter routing method

$route['signin'] = '/home/signin';

routing work like this, update the route file as you need

$route['YOUR_METHOD_NAME'] = '/YOUR_CONTROLLER_NAME/YOUR_METHOD_NAME';
Sign up to request clarification or add additional context in comments.

2 Comments

i want my links to be like example.com/signin rather than example.com/?home/signin i tried to add this to my routes.php here $route['signin'] = '/home/signin'; but still does not work it still shows example.com/?home/signin please help me
How do you link that page? did you try to access just simply example.com/signin in your url or a tag from any page?
0

Try with this: this my htaccess

// .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
$route['404_override']         = 'my404';
$route['translate_uri_dashes'] = false;

$route['default_controller'] = '/Home';
$route['home']                  =  '/Home/index';
$route['user-list']                     = '/Admin/users';
$route['setting']                           = '/General/account';
$route['payment-paypal']            = '/Payment/paymentByPaypal';

and access this way: http://localhost/ (this accesses a Home controller with the index method) or http://localhost/payment-paypal (this accesses a Payment controller with the PaymentByPaypal method)

5 Comments

really sorry sir but your giving examples with spanish websites it did not work for me at all, my controllers are Home, Admin, Browse, General, Payment, Updater can you give examples with them exactly so i can try please
You can give an example of how you want to have your urls.
i want my links to be like example.com/signin rather than example.com/?home/signin i tried to add this to my routes.php here $route['signin'] = '/home/signin'; but still does not work it still shows example.com/?home/signin please help me
have you changed your htacces?
yes i did it, but it returned the index.php to url i wish to remove them both index.php? and controller

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.