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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:17:15+00:00 2026-06-07T02:17:15+00:00

I am new to url re-writng and is currently facing problems with rewriting url

  • 0

I am new to url re-writng and is currently facing problems with rewriting url for multiple applications in codeigniter. I have scanned the whole stackoverflow with some potential answers but it is still not solving my problems entirely

My directory at the root is as such

  • -application
  • –administrator
  • –frontend

What I am looking for is for my users to access my web site (frontend) with http://www.mydomain.com/ And my admin (backend) as http://www.mydomain.com/admin/

my current .htaccess is as such

<IfModule mod_rewrite.c>
    RewriteEngine On
# If the user types just "admin".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin$ administrator.php [L,QSA]

# If the user enter in any admin section, like "admin/section".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin\/(.*)$ administrator\.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]

    ErrorDocument 404 /index.php
</IfModule> 

code from CodeIgniter multi-application .htaccess problem

I can get what I desire at the front end with the above .htaccess, but I can’t get it working on my back end. Basically, http://www.domain.com/admin gives a 404 page not found error.

Please advice me on the problem. Also, please guide me on where I should place this .htaccess file? at the root? inside the application folder? or inside the frontend and administrator folder respectively.

Many thanks.

Regards.

  • 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-07T02:17:17+00:00Added an answer on June 7, 2026 at 2:17 am

    Found a way to work with this problem already. It is not a very smart way of doing it but it at least worked.

    First, I created an ‘admin’ folder in the root, with a copy of the application’s index.php
    Which effectively make my directory looking like this.

        -admin
        --.htaccess
        --index.php
        -application
        --frontend
        --administrator
        -index.php
        -.htaccess
    

    For this solution you will need to have two .htaccess files in different location.
    For the .htaccess at the root, it should look like this.

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond $1 !^(index\.php|update\.php|administrator\.php|assets|admin|robots\.txt|favicon\.ico)
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    
    <IfModule !mod_rewrite.c>
        ErrorDocument 404 /index.php
    </IfModule> 
    

    For the .htaccess in the admin folder

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

    While this works on localhost, it is noteworthy that it may not work on rented servers because the file system in your host may be different.

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

Sidebar

Related Questions

I have a doubt about orkut's new URL Writing method. Earlier the home page
URL url = new URL(http://localhost:8080/Work/images/abt.jpg); InputStream in = new BufferedInputStream(url.openStream()); ByteArrayOutputStream out = new
URL url = new URL(http://www.example.com/comment); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod(POST); Is connection.setRequestProperty(key,
URL url = new URL(http://twitter.com/statuses/update.xml); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); String cridentials =
URL oauth = new URL(URL); URLConnection oauth_connection = oauth.openConnection(); BufferedReader in = new BufferedReader(new
An example: getAppletContext().showDocument( new URL(javascript:alert(document.getElementById('textbox').value); )); Instead of alerting this textbox value, I want
Below code : URL oracle = new URL(http://www.oracle.com/); URLConnection inputStream =oracle.openConnection(); InputStream in =
I'm trying to define a new URL handler under OSX that will point at
private void validateXML(DOMSource source) throws Exception { URL schemaFile = new URL(http://www.csc.liv.ac.uk/~valli/modules.xsd); SchemaFactory schemaFactory
I get BufferedReader from the following networking code. URL url = new URL(request); HttpURLConnection

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.