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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:48:09+00:00 2026-06-15T15:48:09+00:00

I have this url structure: proyectos.example.com/ci-doctrine/index.php proyectos.example.com/ci-doctrine/index.php/welcome proyectos.example.com/ci-doctrine/index.php/blog proyectos.example.com/ci-doctrine/admin.php proyectos.example.com/ci-doctrine/admin.php/welcome proyectos.example.com/ci-doctrine/admin.php/dashboard For index.php urls,

  • 0

I have this url structure:

proyectos.example.com/ci-doctrine/index.php
proyectos.example.com/ci-doctrine/index.php/welcome
proyectos.example.com/ci-doctrine/index.php/blog
proyectos.example.com/ci-doctrine/admin.php
proyectos.example.com/ci-doctrine/admin.php/welcome
proyectos.example.com/ci-doctrine/admin.php/dashboard

For index.php urls, I would like to keep this format:

proyectos.example.com/ci-doctrine/    //default index view
proyectos.example.com/ci-doctrine/welcome
proyectos.example.com/ci-doctrine/blog

So, my .htaccess looks like:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

The .htaccess code above works fine. The problem resides for admin.php urls, because I want the urls format like (keeping the ‘admin’ word):

proyectos.example.com/ci-doctrine/admin
proyectos.example.com/ci-doctrine/admin/dashboard
proyectos.example.com/ci-doctrine/admin/welcome

Then, I have editted my htaccess like:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{REQUEST_URI} ^admin/(.*)$ [NC]
  RewriteRule ^admin/(.*)$ /admin.php/$1 [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

But when I browse proyectos.example.com/ci-doctrine/admin I get a 500 error, so I suppose that my rule for admin file is not working good enought.

Logs

I have reviewed the error_log, and each time I try to acesss proyectos.example.com/ci-doctrine/admin it prints a message:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

Followed by a list of redirections:

[Wed Dec 05 09:47:07 2012] [error] [client 201.192.30.254] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Wed Dec 05 09:47:07 2012] [debug] core.c(3112): [client 201.192.30.254] r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/proyectos/index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /index.php/admin
[Wed Dec 05 09:47:07 2012] [debug] core.c(3118): [client 201.192.30.254] redirected from r->uri = /ci-doctrine/admin

Directory structure

For troubleshooting porpuses, below you can find my dir structure

public_html/
    .htaccess/
    index.php
    proyectos/
        ci-doctrine/
            .htaccess
            index.php
            admin.php

Document root .htaccess

In the root, I have another installation of my application like in the subdomain proyectos.example.com/ci-doctrine does, for this reason I am applying the same rule for index.php for urls.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

UPDATE > working code

Well, with the help of @anubhava I got this work:

Document root .htaccess:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Subdomain .htaccess:

# If the user types "index.php" or "admin.php".
RewriteCond $1 !^(index\.php|admin\.php|images|robots\.txt)

# If the user types just "admin".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin$ admin\.php [L,QSA]

# If the user enter in any admin section, like "admin/section".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin\/(.*)$ admin\.php/$1 [L,QSA]

# If the user types any site section, like "site/section".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php/$1 [L,QSA]
  • 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-15T15:48:10+00:00Added an answer on June 15, 2026 at 3:48 pm

    Actually the problem is one extra (and incorrect) RewriteCond in your first rule. Here is the modified and correct code that should work for you:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^admin/(.*)$ /admin.php/$1 [L,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    EDIT: Your $DOCUMENT_ROOT/.htaccess should be modified like this:

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
    
      RewriteCond %{HTTP_HOST} ^(www\.)?rootdomain\.com [NC]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ /index.php/$1 [L]
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
I have this URL example.com/photo?people I want to rewrite this URL in the form
How can I hide the parameters in Codeigniter? I have this URL: http://example.com/profile/1 I
I have a simple login page and the URL structure is like www.mydomain.com/admin/auth I
I have a URL structure like this http://domain.com/page/thing1 http://domain.com/page/thing2 http://domain.com/page/thing3 I want to: remove
i have following url structure http://www.mydomain.com/vpn-offers-p3.html this page should be redirect to http://www.mydomain.com/vpn-offers.php?st=60&page=3 here
Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
i have this youtube url http://www.youtube.com/watch?v=9N51Etoikfw&feature=youtube_gdata i need to remove the feature parameter and
I have a legacy PHP application that uses the following URL structure /product_info.php?products_id=YYY where
I have seen a lot of sites using this URL structure: webapp/wcs/stores/servlet webapp/wcs/stores/OrderShippingDisplayView What

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.