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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:58:26+00:00 2026-06-03T16:58:26+00:00

I know this question might have been asked a few times already, but I

  • 0

I know this question might have been asked a few times already, but I need a specific solution for CodeIgniter, using an .htaccess file that would send every request to an index_failsafe.php file instead of the normal index.php but ONLY if the url doesn’t start with ‘admin’. Example:

  1. http://www.myhost.com/admin -> work as usual
  2. http://www.myhost.com/welcome -> sent to failsafe page

in case 1:

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

in case 2:

RewriteRule ^.*$ index_failsafe.php/$1 [L] 

My rewrite conditions are:

   RewriteEngine On

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

Is it possible to do this?

  • 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-03T16:58:28+00:00Added an answer on June 3, 2026 at 4:58 pm

    Personally I do it by IP – so I can take my site offline, but I still have full access to it (to test new functions and make sure it is working before bringing back up)

    RewriteEngine on
    
        # For maintenance:
        # If your IP address is 1.1.1.1 - then dont re-write
        RewriteCond %{REMOTE_ADDR} !^1\.1\.1\.1
        # If the person is requesting the maintenance page, also dont rewrite (prevent loops)
        RewriteCond %{REQUEST_URI} !/maintenance.html$ 
        # Otherwise rewrite all requests to the maintenance page
        RewriteRule $ /maintenance.html [R=302,L]
    
    
        # do not rewrite links to the documentation, assets and public files
        RewriteCond $1 !^(assets)
    
        # do not rewrite for php files in the document root, robots.txt or the maintenance page
        RewriteCond $1 !^([^\..]+\.php|robots\.txt|maintenance\.html)
    
        # but rewrite everything else
        RewriteRule ^(.*)$ index.php/$1 [L]
    

    just change !^1.1.1.1 to your current IP. i.e. !^121.65.56.65

    If your not sure what your IP is – just google “what is my IP” – and it will show up as the first hit

    But in terms of your specific question – this should work:

    RewriteCond %{REQUEST_URI} !/admin$ 
    RewriteRule $ /index_failsafe.php [R=302,L]
    

    edit:

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

Sidebar

Related Questions

I know this question might have already been discussed a thousands of times but
I know that this question might have been asked like 100 times, but, believe
I know that this question has been asked loads of times, but I have
I know this question has been asked multiple number of times and i have
I know this question has been asked before, but no one has given any
I asked this same question about a week ago, but I might not have
I know this question might be repeated many times but would really appreciate any
This question has been asked several times in various forms but I haven't found
Now I know this basic question has been asked before, but I must be
I know this question has been asked before, but this was one and a

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.