Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:52:20+00:00 2026-06-09T12:52:20+00:00

I need to show 404 page when user types index.php within the URL as:

  • 0

I need to show 404 page when user types index.php within the URL as:

http://localhost:8080/site_name/index.php/home

I add this in routes.php $route['index.php/(:any)'] = 'custom404';

It didn’t help; when user types http://localhost:8080/site_name/index.php/home home page shows up instead of 404 not found.

Any idea how to show 404 page when user types index.php within the URL?

My htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /site_name/index.php/$1 [L]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:52:21+00:00Added an answer on June 9, 2026 at 12:52 pm

    You can remove the index.php from your urls all together. It is on by default with CodeIgniter but you can remove it easily, just follow the guide here at their user guide:
    http://codeigniter.com/user_guide/general/urls.html

    EDIT: it should also be known that the index.php in the url is not part of your controller, it is simply something put there by CodeIgniter so you cannot remove it by using your routes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to show more than one report on a Page like Classic Report,
I want to rewrite /home to the index.php and /edit to edit.php , but
Please consider the following structure of my website: www.mydomain.com/ www.mydomain.com/index.php www.mydomain.com/404.php www.mydomain.com/css www.mydomain.com/blog/ How
I want to display 404 error page for that i have made error404.php file
I'm trying to forward all PDF requests made to http://files.domain.com through an index.php file
Fetch a URL - mywebiste.com/blah.php --> returns 404 Fetch a URL - mywebsite.com/blah.php -->
We need to show quotes related with the current document. This user story will
I need show a notication modal window.. But since its a fluid layout the
me again... I need show 10 or 20 or 50 results number of results
I need to show a form exactly in front of another form, this lead

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.