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 1089741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:16:11+00:00 2026-05-16T23:16:11+00:00

In a similar way to codeigniter I want to catch all requests and rewrite

  • 0

In a similar way to codeigniter I want to catch all requests and rewrite them to an index.php file which sites in the root of my web accessible folder. Unlike the examples on codeigniter however I do not want to check whether the file exists before I rewrite it (because I dont want to allow direct access to any files).

I have had partial success using the following rewrite rule:

RewriteRule ^(.*)$ index.php/$1/ [L]

However the only way I can get it to work is by adding a rewrite condition before it which does some sort of check to make sure the request is not for index.php, otherwise I get a 500 internal server error. Ive had a look at the error log and it seems it is due to too much reccursion. I understand that if the request index.php it doesnt matter anyway because they will hit the right file but I dont understand the need for this condition and I feel dirty including it when I dont know why it has to be there?

The working rule is…

RewriteCond %{REQUEST_URI} !^/index.php/

Its also worth mentioning that this rewrite condition worked aswell but again I dont know why its needed!

RewriteCond %{REQUEST_FILENAME} !index.php
  • 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-05-16T23:16:12+00:00Added an answer on May 16, 2026 at 11:16 pm

    RewriteCond means, the following RewriteRule is only evaluated if these conditions are met.
    In your case, in words “If the requested URI doesn’t start with /index.php, then reroute to index.php”.

    You need that check, because otherwise you would be rerouting index.php to itself in an infinite loop.

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

Sidebar

Related Questions

Similar to the way Resharper makes copying or moving a type to another file
Similar to Ubiquitous way to get the root directory an application is running in
Basically I want to use uniqueidentifier in similar way as identity. I don't want
I want to create an XML string in Flex 3 in a similar way
I created a page--front.tpl.php successfully. Is there a similar way to create an instance
I want to get a value from the http_referer in the same/similar way you'd
I am looking to do something similar to the way CodeIgniter's load object works.
I want attachment_fu to resize my thumbnails in a similar way to how flickr,
I'm creating a Facebook web application which functions in a similar way to a
I want to load plugins in a similar way as shown here however the

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.