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

The Archive Base Latest Questions

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

I have a site that uses wordpress for the frontend & a Codeigniter app

  • 0

I have a site that uses wordpress for the frontend & a Codeigniter app for a ‘webshop’ backend. The WordPress structure isn’t in the root, rather it is in the /wp directory.

I require some .htaccess rules that rewrite as follows:
I am trying to do the following –

  1. if users goes to http://www.company.com then it does the rewrite rule for the wp (wordpress) folder
  2. if users goes to admin.company.com then it does the rewrite rule to the index.php (for the Codeigniter app)
  3. The final bit is required for the mod_rewrite for wordpress URLS.

The problem I have is that I cannot get both rule 1 and rule 2 working because of RewriteBase rule used – can anyone suggest how to get to use RewriteBase per rule (eg more than once) or similar command to do this?

RewriteCond %{HTTP_HOST} ^(www.)?company.com$
RewriteRule ^(/)?$ wp [L]

RewriteCond %{HTTP_HOST} ^admin.company.com$
RewriteRule index.php [L]

RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]

RewriteRule ^(.*)$ /index.php?$1 [L]
  • 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-27T23:05:28+00:00Added an answer on May 27, 2026 at 11:05 pm

    If you have the codeigniter index file in your root, then you can probably leave the .htaccess file alone and just use the routes file in your codeigniter app.

    $subdomain_arr = explode('.', $_SERVER['HTTP_HOST'], 2); //creates the various parts  
    $subdomain_name = $subdomain_arr[0]; //assigns the first par
    
    if ($subdomain_name == 'admin')) {
        $route['uristring'] = "controller/method";
    } elseif($subdomain_name == 'www')) {
        $route['uristring'] = "controller/method"; // in this method, just do a redirect to your /wp folder.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Wordpress site that uses two databases -- one section queries one
I have a site that uses the SqlMembershiprovider. Its is a webshop. The user
I have a site that uses wordpress for community purposes, it is installed under
I have a WordPress site (on my localhost) that uses a <ul> for a
I have a site that uses a couple DropDownLists that are databound. I was
I have a site that uses a large centered background image, which naturally loads
I have a site that uses a menu control tied to a sitemapdatasource which
Ok, so I have a site that uses the google maps API, and I
I have a PHP site that uses a fairly common authentication scheme. The entire
I have a web site that I administer that uses Apache 2.0 on 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.