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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:08:25+00:00 2026-06-18T00:08:25+00:00

I have the following scenario: A Codeigniter Website (Lets call it WebA ) is

  • 0

I have the following scenario:

A Codeigniter Website (Lets call it WebA) is installed on the root of the sebserver “/”, accessed from the domain: http://www.example.com.

Another Codeigniter Website (Lets call it WebB) is installed in the same webserver in a subfolder “/subfolder”, accessed from the domain: http://www.example2.com.

I have 2 .htacces files that remove the index.php, installed on WebA and in WebB:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (auth|register|secure)
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(static|auth|register|secure)
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301]

</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType application/octet-stream .otf .ttf

I have configured on WebA in /application/config/config.php:

$config['base_url'] = 'http://example.com/';

And in WebB in /subfolder/application/config/config.php:

$config['base_url'] = 'http://example2.com/';

Error 1:

With This configuration when I access http://www.example2.com I get:

404 Page Not Found

Error 2:

If I change WebB’s .htaccess RewriteBase line to:

RewriteBase /subfolder/

I get the html outputted, in the index “http://example2.com/&#8221; but it will not load any of my JS or CSS, because instead of loading the script it loads this:

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message:  Trying to get property of non-object</p>
<p>Filename: controllers/html.php</p>
<p>Line Number: 60</p>

</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message:  Cannot modify header information - headers already sent by (output started at /var/www/subfolder/system/core/Exceptions.php:185)</p>
<p>Filename: helpers/url_helper.php</p>
<p>Line Number: 546</p>

</div>

It also outputs this error when trying to navigate the pages but I get no Html.

The first error seems to be because of the missconfiguration my database models are not working.

Error 3:

If I change WebB’s config.php to:

$config['base_url'] = 'http://example.com/subfolder/';

And WebB’s RewriteBase line in .htaccess to:

RewriteBase /subfolder/

Its working fine, when accessed by http://www.example.com/subfolder/ and http://www.example2.com, but the problem are the WebB’s links, which I need them to be as http://www.example2.com and not http://www.example.com/subfolder/

WebA is always working.

I have the same code working on multiple websites without any problems, but I have never faced this scenario before. Any ideas?

  • 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-18T00:08:26+00:00Added an answer on June 18, 2026 at 12:08 am

    Ok, so I finally got this working, what I did:

    I asked my system administrator to change all the websites to use Virtualhosts as Hicham LEMGHARI sugested, but I dont know if he did it right because I still had the errors on WebB:

    WebA installed in /var/www/subfolderA

    WebB installed in /var/www/subfolderB

    WebA

    WebA’s htaccess file configured RewriteBase line as:

    RewriteBase /subfolderA/
    

    And config.php:

    $config['base_url'] = 'http://example.com/';
    

    WebB

    WebB’s htacces file changed completely to just these 4 lines:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L] 
    

    And config.php to:

    $config['base_url'] = 'http://example2.com/';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenario: Entities are loaded from the database. One of them
I have a following scenario: I have an ASP.NET MVC website/webapp where almost all
I have the following scenario: A user on one our customer's website clicks a
I have following scenario: Lets say we have two different webparts operating on the
I have the following scenario. I have a PHP website witch contains about 3
I have the following scenario: a table that is accessed (update, delete, insert and
I am trying to understand isolation/locks in SQL Server. I have following scenario in
I have the following scenario: in activity A, when a user clicks a button,
I have the following scenario: if(xml.Descendants(ns + Children).FirstOrDefault() != null) { XElement children =
I have the following scenario, a Customer who can have bank accounts in several

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.